]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-ip.c
PIM: Fix some length checks
[tcpdump] / print-ip.c
index a77bfce832057c7c5f222e90425a42f62730df50..f4c5fae8e6f89f9bc19d2c49d503fa6801be0ece 100644 (file)
@@ -470,7 +470,9 @@ ip_print(netdissect_options *ndo,
                ND_PRINT("%s > %s: ",
                         ipaddr_string(ndo, ip->ip_src),
                         ipaddr_string(ndo, ip->ip_dst));
-               goto trunc;
+               nd_print_trunc(ndo);
+               nd_pop_packet_info(ndo);
+               return;
            }
        }
 
@@ -517,14 +519,13 @@ ip_print(netdissect_options *ndo,
 
 trunc:
        nd_print_trunc(ndo);
-       nd_pop_packet_info(ndo);
        return;
 }
 
 void
 ipN_print(netdissect_options *ndo, const u_char *bp, u_int length)
 {
-       ndo->ndo_protocol = "ipN";
+       ndo->ndo_protocol = "ipn";
        if (length < 1) {
                ND_PRINT("truncated-ip %u", length);
                return;