]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-ip.c
EIGRP: Modernize packet parsing style.
[tcpdump] / print-ip.c
index 891ce19ba1c50194ab23316ffe35dd89f11406cd..7cec64041dd84ff99a46a98fe355db1c2dfa58f3 100644 (file)
@@ -27,8 +27,6 @@
 
 #include "netdissect-stdinc.h"
 
-#include <string.h>
-
 #include "netdissect.h"
 #include "addrtoname.h"
 #include "extract.h"
@@ -71,11 +69,15 @@ ip_printroute(netdissect_options *ndo,
                ND_PRINT(" [bad ptr %u]", GET_U_1(cp + 2));
 
        for (len = 3; len < length; len += 4) {
+               ND_TCHECK_4(cp + len);  /* Needed to print the IP addresses */
                ND_PRINT(" %s", GET_IPADDR_STRING(cp + len));
                if (ptr > len)
                        ND_PRINT(",");
        }
        return (0);
+
+trunc:
+       return (-1);
 }
 
 /*
@@ -498,7 +500,6 @@ ip_print(netdissect_options *ndo,
 
 trunc:
        nd_print_trunc(ndo);
-       return;
 }
 
 void