]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Ethernet: Remove two useless tests
authorFrancois-Xavier Le Bail <[email protected]>
Thu, 13 Sep 2018 12:24:23 +0000 (14:24 +0200)
committerFrancois-Xavier Le Bail <[email protected]>
Thu, 13 Sep 2018 12:24:23 +0000 (14:24 +0200)
Because packet length (len) >= capture length (caplen).

(see the sanity checks in print.c, pretty_print_packet() function)

print-ether.c

index d0eaf8cd7ecc1cdf93096d733b844fc0ea489edb..1158b7945efa67c46fc5419993807ea9aa25b08f 100644 (file)
@@ -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);
        }