]> The Tcpdump Group git mirrors - tcpdump/commit
Ethernet: Rework the length checks
authorFrancois-Xavier Le Bail <[email protected]>
Sun, 21 Nov 2021 14:33:24 +0000 (15:33 +0100)
committerFrancois-Xavier Le Bail <[email protected]>
Sun, 28 Nov 2021 13:53:47 +0000 (14:53 +0100)
commit6edc1387739841ed462cdd4b550e3677b056fa60
treec298f48d8a8f11addc2a2b2c14d0af5a7c919ed2
parentc90a33ba010d58463971b3bb01442847cae6525d
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.

(cherry picked from commit d52b757efa7b0678e34c0ffe32d1c0da29bbb604)
print-ether.c