From: Francois-Xavier Le Bail Date: Sun, 21 Nov 2021 14:33:24 +0000 (+0100) Subject: Ethernet: Rework the length checks X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/d52b757efa7b0678e34c0ffe32d1c0da29bbb604?hp=d52b757efa7b0678e34c0ffe32d1c0da29bbb604 Ethernet: Rework the length checks Add a sanity check: packet length need to be >= capture length (Like a sanity check in print.c, pretty_print_packet() function) Remove a now useless test: Because packet length (length) >= capture length (caplen), when caplen >= ETHER_HDRLEN + switch_tag_len, length cannot be < ETHER_HDRLEN + switch_tag_len. ---