summaryrefslogtreecommitdiff
path: root/contrib/tcpdump/print-ether.c
diff options
context:
space:
mode:
authorGarrett Wollman <wollman@FreeBSD.org>1997-12-08 21:42:35 +0000
committerGarrett Wollman <wollman@FreeBSD.org>1997-12-08 21:42:35 +0000
commit0bfc6e67069a0cdb1a85fbc0bd93267e471b8027 (patch)
tree302b8c0b1d3257e8cfa3b6f6a3cf179fa13cf454 /contrib/tcpdump/print-ether.c
parente0572d523f0cb02c92f6cff34aa73304a4720aca (diff)
Notes
Diffstat (limited to 'contrib/tcpdump/print-ether.c')
-rw-r--r--contrib/tcpdump/print-ether.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/contrib/tcpdump/print-ether.c b/contrib/tcpdump/print-ether.c
index 2c92d4f105ef..cabbe2bf2d73 100644
--- a/contrib/tcpdump/print-ether.c
+++ b/contrib/tcpdump/print-ether.c
@@ -158,6 +158,13 @@ int
ether_encap_print(u_short ethertype, const u_char *p,
u_int length, u_int caplen)
{
+ if (ethertype == 0x8100) { /* IEEE 802.1Q vlan tagging encapsulation */
+ printf ("[vlan %d] ", ntohs(*(u_short *)p) & 0x17ff);
+ ethertype = ntohs(((u_short *)p)[1]);
+ p += 4;
+ length -= 4;
+ caplen -= 4;
+ }
extracted_ethertype = ethertype;
switch (ethertype) {