summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuy Harris <gharris@sonic.net>2023-04-10 00:27:05 -0700
committerGuy Harris <gharris@sonic.net>2023-04-10 00:27:05 -0700
commit0a31117de8448684b86408fbe639aa398fe7316c (patch)
tree9c536d7abc829f48c559dfa37e9f33c93d939f07
parent86bed03b4740e542339f45dba70a556bb8433758 (diff)
downloadtcpdump-0a31117de8448684b86408fbe639aa398fe7316c.tar.gz
cdp: only hex-dump unknown TLVs in verbose mode.
If we're not in verbose mode, we only show the Device ID TLV, so there's no good reason to show a hex dump of other TLVs if we don't happen to have a printer for them - especially given that we don't show the type value for the TLV, so it's not clear to what type value those hex bytes correspond. Furthermore, the hex dump causes the non-verbose output to be multiple lines, and causes the ", length N" to show up at the end of the hex dump rather than at the end of the first line. I.e., it seems as if either 1) printing the hex dump in non-verbose mode wasn't intended or 2) it was intended by whoever intended it didn't look into what it would involve.
-rw-r--r--print-cdp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/print-cdp.c b/print-cdp.c
index 157e5ed5..bbeab76d 100644
--- a/print-cdp.c
+++ b/print-cdp.c
@@ -309,7 +309,7 @@ cdp_print(netdissect_options *ndo,
}
}
- if (!covered) {
+ if (ndo->ndo_vflag && !covered) {
ND_TCHECK_LEN(tptr, len);
print_unknown_data(ndo, tptr, "\n\t ", len);
}