]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-atalk.c
Force -t on in TESTonce.
[tcpdump] / print-atalk.c
index a94c29ce25fd3f7f573ded68f2644e3dabe76476..9d7d69d3d790189f01ca5d430980b98d021d2ac4 100644 (file)
@@ -79,7 +79,7 @@ ltalk_if_print(netdissect_options *ndo,
 {
        u_int hdrlen;
 
-       hdrlen = llap_print(ndo, p, h->caplen);
+       hdrlen = llap_print(ndo, p, h->len);
        if (hdrlen == 0) {
                /* Cut short by the snapshot length. */
                return (h->caplen);
@@ -216,6 +216,15 @@ aarp_print(netdissect_options *ndo,
 
        ND_PRINT((ndo, "aarp "));
        ap = (const struct aarp *)bp;
+       if (!ND_TTEST(*ap)) {
+               /* Just bail if we don't have the whole chunk. */
+               ND_PRINT((ndo, " [|aarp]"));
+               return;
+       }
+       if (length < sizeof(*ap)) {
+               ND_PRINT((ndo, " [|aarp %u]", length));
+               return;
+       }
        if (EXTRACT_16BITS(&ap->htype) == 1 &&
            EXTRACT_16BITS(&ap->ptype) == ETHERTYPE_ATALK &&
            ap->halen == 6 && ap->palen == 4 )