Browse Source

patch over some code which was causing bounds warnings to please clang

Caleb James DeLisle 8 years ago
parent
commit
77e27ab1a6
1 changed files with 2 additions and 2 deletions
  1. 2 2
      net/TUNAdapter.c

+ 2 - 2
net/TUNAdapter.c

@@ -88,7 +88,7 @@ static Iface_DEFUN incomingFromTunIf(struct Message* msg, struct Iface* tunIf)
     }
 
     // first move the dest addr to the right place.
-    Bits_memmoveConst(&header->destinationAddr[-DataHeader_SIZE], header->destinationAddr, 16);
+    Bits_memmoveConst(header->destinationAddr - DataHeader_SIZE, header->destinationAddr, 16);
 
     Message_shift(msg, DataHeader_SIZE + RouteHeader_SIZE - Headers_IP6Header_SIZE, NULL);
     struct RouteHeader* rh = (struct RouteHeader*) msg->bytes;
@@ -139,7 +139,7 @@ static Iface_DEFUN incomingFromUpperDistributorIf(struct Message* msg,
     Assert_true(type <= ContentType_IP6_RAW);
 
     // Shift ip address into destination slot.
-    Bits_memmoveConst(&hdr->ip6[DataHeader_SIZE - 16], hdr->ip6, 16);
+    Bits_memmoveConst(hdr->ip6 + DataHeader_SIZE - 16, hdr->ip6, 16);
     // put my address as destination.
     Bits_memcpyConst(&hdr->ip6[DataHeader_SIZE], ud->myIp6, 16);