From: Guy Harris Date: Sun, 5 Jul 2015 01:03:40 +0000 (-0700) Subject: "length" is now the *remaining* packet length. X-Git-Tag: tcpdump-4.9.0-bp~83 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/a7be3fdba438f8ea80586d2a00b23fb9a96d602c "length" is now the *remaining* packet length. The loop that processes MPLS labels decrements the length for each label, so it's the remaining length; don't subtract the total length of the MPLS labels from it before handing it to packet printers. --- diff --git a/print-mpls.c b/print-mpls.c index f6ee434e..ba422334 100644 --- a/print-mpls.c +++ b/print-mpls.c @@ -186,22 +186,22 @@ mpls_print(netdissect_options *ndo, const u_char *bp, u_int length) */ if (pt == PT_UNKNOWN) { if (!ndo->ndo_suppress_default_print) - ND_DEFAULTPRINT(p, length - (p - bp)); + ND_DEFAULTPRINT(p, length); return; } ND_PRINT((ndo, ndo->ndo_vflag ? "\n\t" : " ")); switch (pt) { case PT_IPV4: - ip_print(ndo, p, length - (p - bp)); + ip_print(ndo, p, length); break; case PT_IPV6: - ip6_print(ndo, p, length - (p - bp)); + ip6_print(ndo, p, length); break; case PT_OSI: - isoclns_print(ndo, p, length - (p - bp), length - (p - bp)); + isoclns_print(ndo, p, length, length); break; default: