From 8aa4617181138d2bd09ac37b164b39e99c5f3d3c Mon Sep 17 00:00:00 2001 From: Francois-Xavier Le Bail Date: Thu, 13 Sep 2018 14:24:23 +0200 Subject: [PATCH] Ethernet: Remove two useless tests Because packet length (len) >= capture length (caplen). (see the sanity checks in print.c, pretty_print_packet() function) --- print-ether.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); } -- 2.39.5