X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/0c93b15d38b3f63047344fcb2ea920e73498bb3d..50dfa7ecebfef0f954f3ac2e6bbbf84ab468f848:/print-brcmtag.c diff --git a/print-brcmtag.c b/print-brcmtag.c index 1e0c5884..efc6a1ee 100644 --- a/print-brcmtag.c +++ b/print-brcmtag.c @@ -27,6 +27,7 @@ #include "netdissect-stdinc.h" +#define ND_LONGJMP_FROM_TCHECK #include "netdissect.h" #include "ethertype.h" #include "addrtoname.h" @@ -131,11 +132,8 @@ brcm_tag_prepend_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, u_int length = h->len; ndo->ndo_protocol = "brcm-tag-prepend"; - if (caplen < BRCM_TAG_LEN) { - ndo->ndo_ll_hdr_len += caplen; - nd_print_trunc(ndo); - return; - } + ND_TCHECK_LEN(p, BRCM_TAG_LEN); + ndo->ndo_ll_hdr_len += BRCM_TAG_LEN; if (ndo->ndo_eflag) { /* Print the prepended Broadcom tag. */