]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Qualify "length" when printing it.
authorGuy Harris <[email protected]>
Fri, 15 Aug 2014 01:19:00 +0000 (18:19 -0700)
committerGuy Harris <[email protected]>
Fri, 15 Aug 2014 01:19:00 +0000 (18:19 -0700)
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".

print-cdp.c

index 74d9a52e30e00b50e68ed9766d9f28e20148f1b4..64056f993407e63664cf4a5c79997aed1c97213f 100644 (file)
@@ -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,