X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/7885cfa165458a05ef818c34ee03affc79f03725..c50f3934dacc4bd3fe16a900d4c63c05acb50ce3:/print-symantec.c diff --git a/print-symantec.c b/print-symantec.c index 5e203581..3cbf2212 100644 --- a/print-symantec.c +++ b/print-symantec.c @@ -21,12 +21,11 @@ /* \summary: Symantec Enterprise Firewall printer */ -#ifdef HAVE_CONFIG_H #include -#endif #include "netdissect-stdinc.h" +#define ND_LONGJMP_FROM_TCHECK #include "netdissect.h" #include "extract.h" #include "ethertype.h" @@ -78,13 +77,9 @@ symantec_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_ u_short ether_type; ndo->ndo_protocol = "symantec"; - if (caplen < sizeof (struct symantec_header)) { - ndo->ndo_ll_header_length += caplen; - nd_print_trunc(ndo); - return; - } + ND_TCHECK_LEN(p, sizeof(struct symantec_header)); - ndo->ndo_ll_header_length += sizeof (struct symantec_header); + ndo->ndo_ll_hdr_len += sizeof (struct symantec_header); if (ndo->ndo_eflag) symantec_hdr_print(ndo, p, length); @@ -110,6 +105,4 @@ symantec_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_ if (!ndo->ndo_suppress_default_print) ND_DEFAULTPRINT(p, caplen); } - - return; }