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-openflow.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-openflow.c')
-rw-r--r-- | print-openflow.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/print-openflow.c b/print-openflow.c index 3b85dd7a..f56b0a35 100644 --- a/print-openflow.c +++ b/print-openflow.c @@ -38,6 +38,7 @@ #include "netdissect-stdinc.h" +#define ND_LONGJMP_FROM_TCHECK #include "netdissect.h" #include "extract.h" #include "openflow.h" @@ -152,7 +153,4 @@ openflow_print(netdissect_options *ndo, const u_char *cp, u_int len) invalid: /* fail the current packet */ nd_print_invalid(ndo); ND_TCHECK_LEN(cp, len); - return; -trunc: - nd_trunc(ndo); } |