Ethernet: Rework the length checks
authorFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>
Sun, 21 Nov 2021 14:33:24 +0000 (15:33 +0100)
committerFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>
Sun, 21 Nov 2021 14:49:13 +0000 (15:49 +0100)
commitd52b757efa7b0678e34c0ffe32d1c0da29bbb604
tree5992a60baa0cbed3999f3ab2214e471adcb154db
parent84b51cad218840ece9115c72705f846060005c6f
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.
print-ether.c