From: Francois-Xavier Le Bail Date: Thu, 13 Sep 2018 12:24:23 +0000 (+0200) Subject: Ethernet: Remove two useless tests X-Git-Tag: tcpdump-4.99-bp~1025 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/8aa4617181138d2bd09ac37b164b39e99c5f3d3c Ethernet: Remove two useless tests Because packet length (len) >= capture length (caplen). (see the sanity checks in print.c, pretty_print_packet() function) --- diff --git a/print-ether.c b/print-ether.c index d0eaf8cd..1158b794 100644 --- a/print-ether.c +++ b/print-ether.c @@ -289,7 +289,7 @@ netanalyzer_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, * Fail if we don't have enough data for the Hilscher pseudo-header. */ ndo->ndo_protocol = "netanalyzer_if"; - if (h->len < 4 || h->caplen < 4) { + if (h->caplen < 4) { nd_print_trunc(ndo); return (h->caplen); } @@ -318,7 +318,7 @@ netanalyzer_transparent_if_print(netdissect_options *ndo, * preamble, and SOF. */ ndo->ndo_protocol = "netanalyzer_transparent_if"; - if (h->len < 12 || h->caplen < 12) { + if (h->caplen < 12) { nd_print_trunc(ndo); return (h->caplen); }