]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Rename nd_trunc() to nd_trunc_longjmp().
authorDenis Ovsienko <[email protected]>
Sun, 27 Sep 2020 20:48:16 +0000 (21:48 +0100)
committerDenis Ovsienko <[email protected]>
Sun, 27 Sep 2020 20:48:16 +0000 (21:48 +0100)
addrtoname.h
extract.h
netdissect.h

index b50739f3b3ad5aa055b2c91492ef4966c573d4ea..94b41d7bee2c2b55c4219385a70a25f93564c1e3 100644 (file)
@@ -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);
 }
 
index 58b8cc19dd98ea6ee9670f59fa80a82d087a6750..2ea7763a6eca381758f38609b3a95fe697c11fa5 100644 (file)
--- 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);
 }
 
index b87b76a7cd2fbc396fe391ecdc3099c7b11a610c..74a113fc8f8eff1585bf9b7a70ba3e78e3313fbd 100644 (file)
@@ -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