From: Guy Harris Date: Fri, 15 Aug 2014 01:19:00 +0000 (-0700) Subject: Qualify "length" when printing it. X-Git-Tag: tcpdump-4.7.0-bp~46^2~7 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/b6a8efae4e08e0b58bfc18cf508ae51aa057c0a7 Qualify "length" when printing it. In the "the TLV length is too short" message, we're printing the length of the entire TLV; report it as "TLV length". If we pass that test, we've subtracted out the lengths of the T and the L, leaving only the length of the V, so report it as "value length". --- diff --git a/print-cdp.c b/print-cdp.c index 74d9a52e..64056f99 100644 --- a/print-cdp.c +++ b/print-cdp.c @@ -109,7 +109,7 @@ cdp_print(netdissect_options *ndo, len = EXTRACT_16BITS(tptr+CDP_HEADER_OFFSET); /* object length includes the 4 bytes header length */ if (len < CDP_HEADER_LEN) { if (ndo->ndo_vflag) - ND_PRINT((ndo, "\n\t%s (0x%02x), length: %u byte%s (too short)", + ND_PRINT((ndo, "\n\t%s (0x%02x), TLV length: %u byte%s (too short)", tok2str(cdp_tlv_values,"unknown field type", type), type, len, @@ -128,7 +128,7 @@ cdp_print(netdissect_options *ndo, if (ndo->ndo_vflag || type == 1) { /* in non-verbose mode just print Device-ID */ if (ndo->ndo_vflag) - ND_PRINT((ndo, "\n\t%s (0x%02x), length: %u byte%s: ", + ND_PRINT((ndo, "\n\t%s (0x%02x), value length: %u byte%s: ", tok2str(cdp_tlv_values,"unknown field type", type), type, len,