X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/6288c273b66fa124b58af66026151fff1d5931c2..refs/heads/master:/print-ipnet.c diff --git a/print-ipnet.c b/print-ipnet.c index 0f745d70..65f62616 100644 --- a/print-ipnet.c +++ b/print-ipnet.c @@ -1,11 +1,10 @@ /* \summary: Solaris DLT_IPNET printer */ -#ifdef HAVE_CONFIG_H #include -#endif #include "netdissect-stdinc.h" +#define ND_LONGJMP_FROM_TCHECK #include "netdissect.h" #include "extract.h" @@ -38,7 +37,6 @@ ipnet_hdr_print(netdissect_options *ndo, const u_char *bp, u_int length) const ipnet_hdr_t *hdr; hdr = (const ipnet_hdr_t *)bp; - ND_TCHECK_SIZE(hdr); ND_PRINT("%u > %u", GET_BE_U_4(hdr->iph_zsrc), GET_BE_U_4(hdr->iph_zdst)); @@ -55,9 +53,6 @@ ipnet_hdr_print(netdissect_options *ndo, const u_char *bp, u_int length) } ND_PRINT(", length %u: ", length); - return; -trunc: - nd_print_trunc(ndo); } static void @@ -65,11 +60,7 @@ ipnet_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen { const ipnet_hdr_t *hdr; - if (caplen < sizeof(ipnet_hdr_t)) { - ndo->ndo_ll_hdr_len += caplen; - nd_print_trunc(ndo); - return; - } + ND_TCHECK_LEN(p, sizeof(ipnet_hdr_t)); ndo->ndo_ll_hdr_len += sizeof(ipnet_hdr_t); if (ndo->ndo_eflag)