]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Return caplen for too-short packets.
authorGuy Harris <[email protected]>
Mon, 19 Mar 2018 18:40:42 +0000 (11:40 -0700)
committerGuy Harris <[email protected]>
Mon, 19 Mar 2018 18:40:42 +0000 (11:40 -0700)
That way, if we don't have a full PKTAP header, we don't print anything
in the -x/-X hex dump or -A ASCII dump (but do print it with
-xx/-XX/-AA).

print-pktap.c

index b4a369054155ded8222f54e2312e6637f1a80f53..825851da05b9253d6505b51f633591a1286965e6 100644 (file)
@@ -109,7 +109,7 @@ pktap_if_print(netdissect_options *ndo,
        ndo->ndo_protocol = "pktap_if";
        if (caplen < sizeof(pktap_header_t) || length < sizeof(pktap_header_t)) {
                ND_PRINT("[|pktap]");
-               return (0);
+               return (caplen);
        }
        hdr = (const pktap_header_t *)p;
        dlt = EXTRACT_LE_U_4(hdr->pkt_dlt);
@@ -123,11 +123,11 @@ pktap_if_print(netdissect_options *ndo,
                 * be expanded in the future)?
                 */
                ND_PRINT("[|pktap]");
-               return (0);
+               return (caplen);
        }
        if (caplen < hdrlen || length < hdrlen) {
                ND_PRINT("[|pktap]");
-               return (hdrlen);
+               return (caplen);
        }
 
        if (ndo->ndo_eflag)