X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/56e6581c34ceec5469b9f37c19b31a36b0256f3c..c6a5cc1bb49bcbc5f74c66bf780b8a1a05e8eb9d:/print-mpls.c diff --git a/print-mpls.c b/print-mpls.c index 3d2a2645..77ed2f3b 100644 --- a/print-mpls.c +++ b/print-mpls.c @@ -69,10 +69,8 @@ mpls_print(netdissect_options *ndo, const u_char *bp, u_int length) ND_PRINT("MPLS"); do { ND_TCHECK_LEN(p, sizeof(label_entry)); - if (length < sizeof(label_entry)) { - ND_PRINT("[|MPLS], length %u", length); - return; - } + if (length < sizeof(label_entry)) + goto trunc; label_entry = EXTRACT_BE_U_4(p); ND_PRINT("%s(label %u", (label_stack_depth && ndo->ndo_vflag) ? "\n\t" : " ", @@ -211,5 +209,5 @@ mpls_print(netdissect_options *ndo, const u_char *bp, u_int length) return; trunc: - ND_PRINT("[|MPLS]"); + nd_print_trunc(ndo); }