diff options
author | Denis Ovsienko <denis@ovsienko.info> | 2020-09-27 21:43:16 +0100 |
---|---|---|
committer | Denis Ovsienko <denis@ovsienko.info> | 2020-09-27 21:45:46 +0100 |
commit | 424961546a4e32086ff7e431794173a2d0901469 (patch) | |
tree | 989f8f484f953f97a6cdc7f8881fb4b71abd26d9 /print-aoe.c | |
parent | 2e63bc0ec11f2b041ee53e2ed986c9d50f135700 (diff) | |
download | tcpdump-424961546a4e32086ff7e431794173a2d0901469.tar.gz |
Introduce and use ND_LONGJMP_FROM_TCHECK.
Apply this to the 4 the recently converted protocols.
HOW TO USE:
Define this in a print-*.c file before including netdissect.h to make
all its ND_TCHECK*() instances longjmp(). Only do this after verifying
that every ND_TCHECK*() in the file is correct and that in every
possible case it is safe to call longjmp() without incurring resource
leaks or any other problems. If it is not safe or feasible to convert
whole file, consider converting one function at a time.
Diffstat (limited to 'print-aoe.c')
-rw-r--r-- | print-aoe.c | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/print-aoe.c b/print-aoe.c index 558eeae2..41f54b99 100644 --- a/print-aoe.c +++ b/print-aoe.c @@ -37,6 +37,7 @@ #include "netdissect-stdinc.h" +#define ND_LONGJMP_FROM_TCHECK #include "netdissect.h" #include "extract.h" #include "addrtoname.h" @@ -198,9 +199,6 @@ aoev1_issue_print(netdissect_options *ndo, invalid: nd_print_invalid(ndo); ND_TCHECK_LEN(cp, len); - return; -trunc: - nd_trunc(ndo); } static void @@ -244,9 +242,6 @@ aoev1_query_print(netdissect_options *ndo, invalid: nd_print_invalid(ndo); ND_TCHECK_LEN(cp, len); - return; -trunc: - nd_trunc(ndo); } static void @@ -297,9 +292,6 @@ aoev1_mac_print(netdissect_options *ndo, invalid: nd_print_invalid(ndo); ND_TCHECK_LEN(cp, len); - return; -trunc: - nd_trunc(ndo); } static void @@ -333,9 +325,6 @@ aoev1_reserve_print(netdissect_options *ndo, invalid: nd_print_invalid(ndo); ND_TCHECK_LEN(cp, len); - return; -trunc: - nd_trunc(ndo); } /* cp points to the Ver/Flags octet */ @@ -392,9 +381,6 @@ aoev1_print(netdissect_options *ndo, invalid: nd_print_invalid(ndo); ND_TCHECK_LEN(cp, len); - return; -trunc: - nd_trunc(ndo); } void @@ -423,8 +409,5 @@ aoe_print(netdissect_options *ndo, invalid: nd_print_invalid(ndo); ND_TCHECK_LEN(cp, len); - return; -trunc: - nd_trunc(ndo); } |