X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/0c93b15d38b3f63047344fcb2ea920e73498bb3d..0023eaa78f123676bfa9c5fba72ea4b8a59aaa70:/print-brcmtag.c diff --git a/print-brcmtag.c b/print-brcmtag.c index 1e0c5884..a3d15e28 100644 --- a/print-brcmtag.c +++ b/print-brcmtag.c @@ -21,14 +21,12 @@ /* \summary: Broadcom Ethernet switches tag (4 bytes) printer */ -#ifdef HAVE_CONFIG_H #include -#endif #include "netdissect-stdinc.h" +#define ND_LONGJMP_FROM_TCHECK #include "netdissect.h" -#include "ethertype.h" #include "addrtoname.h" #include "extract.h" @@ -131,11 +129,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. */