summaryrefslogtreecommitdiff
path: root/print-ether.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2019-04-23 13:47:33 -0700
committerGuy Harris <guy@alum.mit.edu>2019-04-23 13:47:47 -0700
commitd338a0a1a95d021e9654b4c80ee64fb4d3e40827 (patch)
treed6b660d5b521ab3183e09e1812b2c43b5376fa62 /print-ether.c
parente7cfa5e63a27e6fbb75e0bbd151af2c7d0d222e9 (diff)
downloadtcpdump-d338a0a1a95d021e9654b4c80ee64fb4d3e40827.tar.gz
Print the Ethertype the same way for Ethertypes in VLAN tags as for others.
Diffstat (limited to 'print-ether.c')
-rw-r--r--print-ether.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/print-ether.c b/print-ether.c
index 02ab0665..4e0d6f0f 100644
--- a/print-ether.c
+++ b/print-ether.c
@@ -254,8 +254,15 @@ recurse:
}
length_type = GET_BE_U_2(p + 2);
- if (ndo->ndo_eflag && length_type > MAX_ETHERNET_LENGTH_VAL)
- ND_PRINT("ethertype %s, ", tok2str(ethertype_values,"0x%04x", length_type));
+ if (ndo->ndo_eflag && length_type > MAX_ETHERNET_LENGTH_VAL) {
+ if (!ndo->ndo_qflag)
+ ND_PRINT("ethertype %s (0x%04x), ",
+ tok2str(ethertype_values,"Unknown", length_type),
+ length_type);
+ else
+ ND_PRINT("%s, ",
+ tok2str(ethertype_values,"Unknown Ethertype (0x%04x)", length_type));
+ }
p += 4;
length -= 4;
caplen -= 4;