]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-brcmtag.c
CHANGES: Add/move change(s) backported to 4.99
[tcpdump] / print-brcmtag.c
index 1e0c5884436822e2f24b6d17f3a6b197d0beb390..a3d15e28fd725d9b5fb5235cfdef5e688867127c 100644 (file)
 
 /* \summary: Broadcom Ethernet switches tag (4 bytes) printer */
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#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. */