X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/39988398861a5fe3f2a89d1f3ff55ad0f7be770b..1bf91b1413a6d0eefb4c49bafdb612befa838556:/print-ip.c diff --git a/print-ip.c b/print-ip.c index cbcdab85..bb1554f9 100644 --- a/print-ip.c +++ b/print-ip.c @@ -358,14 +358,14 @@ again: case IPPROTO_IPCOMP: { - int enh; - ipds->advance = ipcomp_print(ndo, ipds->cp, &enh); - if (ipds->advance <= 0) - break; - ipds->cp += ipds->advance; - ipds->len -= ipds->advance; - ipds->nh = enh & 0xff; - goto again; + ipcomp_print(ndo, ipds->cp); + /* + * Either this has decompressed the payload and + * printed it, in which case there's nothing more + * to do, or it hasn't, in which case there's + * nothing more to do. + */ + break; } case IPPROTO_SCTP: @@ -530,13 +530,14 @@ ip_print(netdissect_options *ndo, ipds->ip = (const struct ip *)bp; ND_TCHECK(ipds->ip->ip_vhl); - if (IP_V(ipds->ip) != 4) { /* print version if != 4 */ + if (IP_V(ipds->ip) != 4) { /* print version and fail if != 4 */ if (IP_V(ipds->ip) == 6) ND_PRINT((ndo, "IP6, wrong link-layer encapsulation ")); else ND_PRINT((ndo, "IP%u ", IP_V(ipds->ip))); + return; } - else if (!ndo->ndo_eflag) + if (!ndo->ndo_eflag) ND_PRINT((ndo, "IP ")); ND_TCHECK(*ipds->ip);