X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/5cace7282089f9de56758c9d8af0b5dd35fa20a1..47b02443f099fc93a7c69041d30bf6f6be552ece:/print-atalk.c?ds=sidebyside diff --git a/print-atalk.c b/print-atalk.c index a94c29ce..9d7d69d3 100644 --- a/print-atalk.c +++ b/print-atalk.c @@ -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 )