]> The Tcpdump Group git mirrors - tcpdump/commit
Ethernet: Allow specifying non-standard Ethernet header length
authorFlorian Fainelli <[email protected]>
Fri, 18 Jan 2019 23:19:38 +0000 (15:19 -0800)
committerFlorian Fainelli <[email protected]>
Sat, 26 Jan 2019 01:00:24 +0000 (17:00 -0800)
commit48e290d807a535cdda391eef7e6992c3429c986a
tree41660cd54315117691caa9e236d2ee5df2fbc328
parent0b3880c91e169db7cfbdce1b18ef4f1e3fd277de
Ethernet: Allow specifying non-standard Ethernet header length

A fair number of proprietary Ethernet switch tagging protocols, such as
Broadcom tags for instance, will place their tag between the MAC SA and
the Type/Length field.

Move the body of ether_print() into ether_print_hdr_len() and specify
the Ethernet header length as an argument to that function.
ether_print() calls ether_print_hdr_len() with a standard Ethernet
header lenght of 14 bytes, while other callers could specify an
arbitrary length. We still assume that the first Length/Type field to
parse is located 2 bytes before the end of that Ethernet header length.

This will be used in a subsequent commit to parse Broadcom tags.
netdissect.h
print-ether.c