X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/4aac37f04316b37b73b99bdcdbfa97347bb2fe51..ed2df84be4d4b16bd595bacc23c6df208ff84401:/print-ether.c diff --git a/print-ether.c b/print-ether.c index 299c2013..4dd253ac 100644 --- a/print-ether.c +++ b/print-ether.c @@ -57,6 +57,7 @@ const struct tok ethertype_values[] = { { ETHERTYPE_8021Q9100, "802.1Q-9100" }, { ETHERTYPE_8021QinQ, "802.1Q-QinQ" }, { ETHERTYPE_8021Q9200, "802.1Q-9200" }, + { ETHERTYPE_MACSEC, "802.1AE MACsec" }, { ETHERTYPE_VMAN, "VMAN" }, { ETHERTYPE_PUP, "PUP" }, { ETHERTYPE_ARP, "ARP"}, @@ -203,6 +204,22 @@ recurse: p += 2; hdrlen += 2; + if (length_type == ETHERTYPE_MACSEC) { + /* + * MACsec, aka IEEE 802.1AE-2006 + * Print the header, and try to print the payload if it's not encrypted + */ + int ret = macsec_print(ndo, &p, &length, &caplen, &hdrlen, &length_type); + + if (ret == 0) { + /* Payload is encrypted; just quit. */ + return (hdrlen + caplen); + } else if (ret > 0) { + /* Problem printing the header; just quit. */ + return (ret); + } + } + /* * Process VLAN tag types. */