X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/81dbf4a0b05092760d0ff0cdd48c692e4769ba99..c39d40a767a1ae36171e5bcbf6f157ff3e80fb6c:/print-brcmtag.c diff --git a/print-brcmtag.c b/print-brcmtag.c index 61521365..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" @@ -118,9 +119,9 @@ brcm_tag_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, u_int length = h->len; ndo->ndo_protocol = "brcm-tag"; - ndo->ndo_ll_hdr_len += 0; - ether_switch_tag_print(ndo, p, length, caplen, - brcm_tag_print, BRCM_TAG_LEN, TRUE); + ndo->ndo_ll_hdr_len += + ether_switch_tag_print(ndo, p, length, caplen, + brcm_tag_print, BRCM_TAG_LEN); } void @@ -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. */ @@ -148,5 +146,6 @@ brcm_tag_prepend_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, /* * Now print the Ethernet frame following it. */ - ether_print(ndo, p, length, caplen, NULL, NULL, TRUE); + ndo->ndo_ll_hdr_len += + ether_print(ndo, p, length, caplen, NULL, NULL); }