From: Denis Ovsienko Date: Sun, 27 Sep 2020 20:48:16 +0000 (+0100) Subject: Rename nd_trunc() to nd_trunc_longjmp(). X-Git-Tag: tcpdump-4.99-bp~191 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/74e3481289129ab31b953a2413a8ab6f07585c6e Rename nd_trunc() to nd_trunc_longjmp(). --- diff --git a/addrtoname.h b/addrtoname.h index b50739f3..94b41d7b 100644 --- a/addrtoname.h +++ b/addrtoname.h @@ -68,7 +68,7 @@ get_linkaddr_string(netdissect_options *ndo, const uint8_t *p, const unsigned int type, const unsigned int len) { if (!ND_TTEST_LEN(p, len)) - nd_trunc(ndo); + nd_trunc_longjmp(ndo); return linkaddr_string(ndo, p, type, len); } @@ -76,7 +76,7 @@ static inline const char * get_etheraddr_string(netdissect_options *ndo, const uint8_t *p) { if (!ND_TTEST_LEN(p, MAC_ADDR_LEN)) - nd_trunc(ndo); + nd_trunc_longjmp(ndo); return etheraddr_string(ndo, p); } @@ -84,7 +84,7 @@ static inline const char * get_le64addr_string(netdissect_options *ndo, const u_char *p) { if (!ND_TTEST_8(p)) - nd_trunc(ndo); + nd_trunc_longjmp(ndo); return le64addr_string(ndo, p); } @@ -93,7 +93,7 @@ get_isonsap_string(netdissect_options *ndo, const uint8_t *nsap, u_int nsap_length) { if (!ND_TTEST_LEN(nsap, nsap_length)) - nd_trunc(ndo); + nd_trunc_longjmp(ndo); return isonsap_string(ndo, nsap, nsap_length); } @@ -101,7 +101,7 @@ static inline const char * get_ipaddr_string(netdissect_options *ndo, const u_char *p) { if (!ND_TTEST_4(p)) - nd_trunc(ndo); + nd_trunc_longjmp(ndo); return ipaddr_string(ndo, p); } @@ -109,7 +109,7 @@ static inline const char * get_ip6addr_string(netdissect_options *ndo, const u_char *p) { if (!ND_TTEST_16(p)) - nd_trunc(ndo); + nd_trunc_longjmp(ndo); return ip6addr_string(ndo, p); } diff --git a/extract.h b/extract.h index 58b8cc19..2ea7763a 100644 --- a/extract.h +++ b/extract.h @@ -576,7 +576,7 @@ EXTRACT_IPV4_TO_NETWORK_ORDER(const void *p) #define ND_TCHECK_16(p) ND_TCHECK_LEN((p), 16) static inline NORETURN void -nd_trunc(netdissect_options *ndo) +nd_trunc_longjmp(netdissect_options *ndo) { longjmp(ndo->ndo_early_end, ND_TRUNCATED); } @@ -587,7 +587,7 @@ static inline uint8_t get_u_1(netdissect_options *ndo, const u_char *p) { if (!ND_TTEST_1(p)) - nd_trunc(ndo); + nd_trunc_longjmp(ndo); return EXTRACT_U_1(p); } @@ -595,7 +595,7 @@ static inline int8_t get_s_1(netdissect_options *ndo, const u_char *p) { if (!ND_TTEST_1(p)) - nd_trunc(ndo); + nd_trunc_longjmp(ndo); return EXTRACT_S_1(p); } @@ -605,7 +605,7 @@ static inline uint16_t get_be_u_2(netdissect_options *ndo, const u_char *p) { if (!ND_TTEST_2(p)) - nd_trunc(ndo); + nd_trunc_longjmp(ndo); return EXTRACT_BE_U_2(p); } @@ -613,7 +613,7 @@ static inline uint32_t get_be_u_3(netdissect_options *ndo, const u_char *p) { if (!ND_TTEST_3(p)) - nd_trunc(ndo); + nd_trunc_longjmp(ndo); return EXTRACT_BE_U_3(p); } @@ -621,7 +621,7 @@ static inline uint32_t get_be_u_4(netdissect_options *ndo, const u_char *p) { if (!ND_TTEST_4(p)) - nd_trunc(ndo); + nd_trunc_longjmp(ndo); return EXTRACT_BE_U_4(p); } @@ -629,7 +629,7 @@ static inline uint64_t get_be_u_5(netdissect_options *ndo, const u_char *p) { if (!ND_TTEST_5(p)) - nd_trunc(ndo); + nd_trunc_longjmp(ndo); return EXTRACT_BE_U_5(p); } @@ -637,7 +637,7 @@ static inline uint64_t get_be_u_6(netdissect_options *ndo, const u_char *p) { if (!ND_TTEST_6(p)) - nd_trunc(ndo); + nd_trunc_longjmp(ndo); return EXTRACT_BE_U_6(p); } @@ -645,7 +645,7 @@ static inline uint64_t get_be_u_7(netdissect_options *ndo, const u_char *p) { if (!ND_TTEST_7(p)) - nd_trunc(ndo); + nd_trunc_longjmp(ndo); return EXTRACT_BE_U_7(p); } @@ -653,7 +653,7 @@ static inline uint64_t get_be_u_8(netdissect_options *ndo, const u_char *p) { if (!ND_TTEST_8(p)) - nd_trunc(ndo); + nd_trunc_longjmp(ndo); return EXTRACT_BE_U_8(p); } @@ -663,7 +663,7 @@ static inline int16_t get_be_s_2(netdissect_options *ndo, const u_char *p) { if (!ND_TTEST_2(p)) - nd_trunc(ndo); + nd_trunc_longjmp(ndo); return EXTRACT_BE_S_2(p); } @@ -671,7 +671,7 @@ static inline int32_t get_be_s_3(netdissect_options *ndo, const u_char *p) { if (!ND_TTEST_3(p)) - nd_trunc(ndo); + nd_trunc_longjmp(ndo); return EXTRACT_BE_S_3(p); } @@ -679,7 +679,7 @@ static inline int32_t get_be_s_4(netdissect_options *ndo, const u_char *p) { if (!ND_TTEST_4(p)) - nd_trunc(ndo); + nd_trunc_longjmp(ndo); return EXTRACT_BE_S_4(p); } @@ -687,7 +687,7 @@ static inline int64_t get_be_s_5(netdissect_options *ndo, const u_char *p) { if (!ND_TTEST_5(p)) - nd_trunc(ndo); + nd_trunc_longjmp(ndo); return EXTRACT_BE_S_5(p); } @@ -695,7 +695,7 @@ static inline int64_t get_be_s_6(netdissect_options *ndo, const u_char *p) { if (!ND_TTEST_6(p)) - nd_trunc(ndo); + nd_trunc_longjmp(ndo); return EXTRACT_BE_S_6(p); } @@ -703,7 +703,7 @@ static inline int64_t get_be_s_7(netdissect_options *ndo, const u_char *p) { if (!ND_TTEST_7(p)) - nd_trunc(ndo); + nd_trunc_longjmp(ndo); return EXTRACT_BE_S_7(p); } @@ -711,7 +711,7 @@ static inline int64_t get_be_s_8(netdissect_options *ndo, const u_char *p) { if (!ND_TTEST_8(p)) - nd_trunc(ndo); + nd_trunc_longjmp(ndo); return EXTRACT_BE_S_8(p); } @@ -721,7 +721,7 @@ static inline uint16_t get_he_u_2(netdissect_options *ndo, const u_char *p) { if (!ND_TTEST_2(p)) - nd_trunc(ndo); + nd_trunc_longjmp(ndo); return EXTRACT_HE_U_2(p); } @@ -729,7 +729,7 @@ static inline uint32_t get_he_u_4(netdissect_options *ndo, const u_char *p) { if (!ND_TTEST_4(p)) - nd_trunc(ndo); + nd_trunc_longjmp(ndo); return EXTRACT_HE_U_4(p); } @@ -739,7 +739,7 @@ static inline int16_t get_he_s_2(netdissect_options *ndo, const u_char *p) { if (!ND_TTEST_2(p)) - nd_trunc(ndo); + nd_trunc_longjmp(ndo); return EXTRACT_HE_S_2(p); } @@ -747,7 +747,7 @@ static inline int32_t get_he_s_4(netdissect_options *ndo, const u_char *p) { if (!ND_TTEST_4(p)) - nd_trunc(ndo); + nd_trunc_longjmp(ndo); return EXTRACT_HE_S_4(p); } @@ -757,7 +757,7 @@ static inline uint16_t get_le_u_2(netdissect_options *ndo, const u_char *p) { if (!ND_TTEST_2(p)) - nd_trunc(ndo); + nd_trunc_longjmp(ndo); return EXTRACT_LE_U_2(p); } @@ -765,7 +765,7 @@ static inline uint32_t get_le_u_3(netdissect_options *ndo, const u_char *p) { if (!ND_TTEST_3(p)) - nd_trunc(ndo); + nd_trunc_longjmp(ndo); return EXTRACT_LE_U_3(p); } @@ -773,7 +773,7 @@ static inline uint32_t get_le_u_4(netdissect_options *ndo, const u_char *p) { if (!ND_TTEST_4(p)) - nd_trunc(ndo); + nd_trunc_longjmp(ndo); return EXTRACT_LE_U_4(p); } @@ -781,7 +781,7 @@ static inline uint64_t get_le_u_5(netdissect_options *ndo, const u_char *p) { if (!ND_TTEST_5(p)) - nd_trunc(ndo); + nd_trunc_longjmp(ndo); return EXTRACT_LE_U_5(p); } @@ -789,7 +789,7 @@ static inline uint64_t get_le_u_6(netdissect_options *ndo, const u_char *p) { if (!ND_TTEST_6(p)) - nd_trunc(ndo); + nd_trunc_longjmp(ndo); return EXTRACT_LE_U_6(p); } @@ -797,7 +797,7 @@ static inline uint64_t get_le_u_7(netdissect_options *ndo, const u_char *p) { if (!ND_TTEST_7(p)) - nd_trunc(ndo); + nd_trunc_longjmp(ndo); return EXTRACT_LE_U_7(p); } @@ -805,7 +805,7 @@ static inline uint64_t get_le_u_8(netdissect_options *ndo, const u_char *p) { if (!ND_TTEST_8(p)) - nd_trunc(ndo); + nd_trunc_longjmp(ndo); return EXTRACT_LE_U_8(p); } @@ -815,7 +815,7 @@ static inline int16_t get_le_s_2(netdissect_options *ndo, const u_char *p) { if (!ND_TTEST_2(p)) - nd_trunc(ndo); + nd_trunc_longjmp(ndo); return EXTRACT_LE_S_2(p); } @@ -823,7 +823,7 @@ static inline int32_t get_le_s_3(netdissect_options *ndo, const u_char *p) { if (!ND_TTEST_3(p)) - nd_trunc(ndo); + nd_trunc_longjmp(ndo); return EXTRACT_LE_S_3(p); } @@ -831,7 +831,7 @@ static inline int32_t get_le_s_4(netdissect_options *ndo, const u_char *p) { if (!ND_TTEST_4(p)) - nd_trunc(ndo); + nd_trunc_longjmp(ndo); return EXTRACT_LE_S_4(p); } @@ -839,7 +839,7 @@ static inline int64_t get_le_s_8(netdissect_options *ndo, const u_char *p) { if (!ND_TTEST_8(p)) - nd_trunc(ndo); + nd_trunc_longjmp(ndo); return EXTRACT_LE_S_8(p); } @@ -849,7 +849,7 @@ static inline uint32_t get_ipv4_to_host_order(netdissect_options *ndo, const u_char *p) { if (!ND_TTEST_4(p)) - nd_trunc(ndo); + nd_trunc_longjmp(ndo); return EXTRACT_IPV4_TO_HOST_ORDER(p); } @@ -857,7 +857,7 @@ static inline uint32_t get_ipv4_to_network_order(netdissect_options *ndo, const u_char *p) { if (!ND_TTEST_4(p)) - nd_trunc(ndo); + nd_trunc_longjmp(ndo); return EXTRACT_IPV4_TO_NETWORK_ORDER(p); } @@ -865,7 +865,7 @@ static inline void get_cpy_bytes(netdissect_options *ndo, u_char *dst, const u_char *p, size_t len) { if (!ND_TTEST_LEN(p, len)) - nd_trunc(ndo); + nd_trunc_longjmp(ndo); UNALIGNED_MEMCPY(dst, p, len); } diff --git a/netdissect.h b/netdissect.h index b87b76a7..74a113fc 100644 --- a/netdissect.h +++ b/netdissect.h @@ -363,7 +363,7 @@ extern void nd_pop_all_packet_info(netdissect_options *); /* Bail out if "l" bytes from "p" were not captured */ #ifdef ND_LONGJMP_FROM_TCHECK -#define ND_TCHECK_LEN(p, l) if (!ND_TTEST_LEN(p, l)) nd_trunc(ndo) +#define ND_TCHECK_LEN(p, l) if (!ND_TTEST_LEN(p, l)) nd_trunc_longjmp(ndo) #else #define ND_TCHECK_LEN(p, l) if (!ND_TTEST_LEN(p, l)) goto trunc #endif