]> The Tcpdump Group git mirrors - tcpdump/commitdiff
LDP: Use nd_trunc_longjmp().
authorDenis Ovsienko <[email protected]>
Fri, 2 Oct 2020 18:11:10 +0000 (19:11 +0100)
committerDenis Ovsienko <[email protected]>
Fri, 2 Oct 2020 19:01:29 +0000 (20:01 +0100)
Do not enable ND_LONGJMP_FROM_TCHECK yet because decode_prefix4() and
decode_prefix6() would require an nd_trunc_longjmp() each in the middle
of the code, maybe a cleaner solution emerges later.

print-ldp.c

index 7f029e6d8bd534ee949b7f39204b4a42a4da8af4..75e6dd2094ab4ee6a172b17c6f10ccbadadaa283 100644 (file)
@@ -538,8 +538,7 @@ ldp_tlv_print(netdissect_options *ndo,
     return(tlv_len+4); /* Type & Length fields not included */
 
 trunc:
-    nd_print_trunc(ndo);
-    return 0;
+    nd_trunc_longjmp(ndo);
 
 invalid:
     return(tlv_len+4); /* Type & Length fields not included */
@@ -697,6 +696,5 @@ ldp_pdu_print(netdissect_options *ndo,
     }
     return pdu_len+4;
 trunc:
-    nd_print_trunc(ndo);
-    return 0;
+    nd_trunc_longjmp(ndo);
 }