Permalink
Browse files

ignore junk ip6 packets in ip6 root test.

  • Loading branch information...
1 parent 14a054e commit 29d093b046f45b80dccb771ae7d14abb20c210ba Caleb James DeLisle committed Dec 9, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 interface/test/TUNInterface_ipv6_root_test.c
@@ -70,7 +70,11 @@ static uint8_t receiveMessageTUN(struct Message* msg, struct Interface* iface)
struct Headers_IP6Header* header = (struct Headers_IP6Header*) msg->bytes;
- Assert_always(msg->length == Headers_IP6Header_SIZE + Headers_UDPHeader_SIZE + 12);
+ if (msg->length != Headers_IP6Header_SIZE + Headers_UDPHeader_SIZE + 12) {
+ int type = (msg->length >= Headers_IP6Header_SIZE) ? header->nextHeader : -1;
+ printf("Message of unexpected length [%u] ip6->nextHeader: [%d]\n", msg->length, type);
+ return 0;
+ }
Assert_always(!Bits_memcmp(header->destinationAddr, testAddrB, 16));
Assert_always(!Bits_memcmp(header->sourceAddr, testAddrA, 16));

0 comments on commit 29d093b

Please sign in to comment.