X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/dc9744f7c6f1aa8f676f84829ee9a69a52952f94..37800b45d586bcf7bb0a1e00ac46a69240614f0b:/print-ip.c diff --git a/print-ip.c b/print-ip.c index 3478de17..f4c5fae8 100644 --- a/print-ip.c +++ b/print-ip.c @@ -340,7 +340,6 @@ ip_print(netdissect_options *ndo, u_int length) { const struct ip *ip; - const u_char *ipend; u_int off; u_int hlen; u_int len; @@ -397,9 +396,7 @@ ip_print(netdissect_options *ndo, /* * Cut off the snapshot length to the end of the IP payload. */ - ipend = bp + len; - if (ipend < ndo->ndo_snapend) - ndo->ndo_snapend = ipend; + nd_push_snapend(ndo, bp + len); len -= hlen; @@ -473,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; } } @@ -498,8 +497,10 @@ ip_print(netdissect_options *ndo, * Ultra quiet now means that all this stuff should be * suppressed. */ - if (ndo->ndo_qflag > 1) + if (ndo->ndo_qflag > 1) { + nd_pop_packet_info(ndo); return; + } /* * This isn't the first frag, so we're missing the @@ -513,6 +514,7 @@ ip_print(netdissect_options *ndo, else ND_PRINT(" ip-proto-%u", ip_proto); } + nd_pop_packet_info(ndo); return; trunc: @@ -523,7 +525,7 @@ trunc: 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;