From a7be3fdba438f8ea80586d2a00b23fb9a96d602c Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Sat, 4 Jul 2015 18:03:40 -0700 Subject: [PATCH] "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. --- print-mpls.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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: -- 2.39.5