X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/fe9b593bac67c5485579ab89f21dd9e4490799fc..69f03c1c03b280b9c5863bfb47e8847d59b4ee6b:/netdissect.c diff --git a/netdissect.c b/netdissect.c index 72923a17..93e633a6 100644 --- a/netdissect.c +++ b/netdissect.c @@ -149,7 +149,7 @@ nd_smi_version_string(void) int nd_push_buffer(netdissect_options *ndo, u_char *new_buffer, - const u_char *new_packetp, u_int newlen) + const u_char *new_packetp, const u_int newlen) { struct netdissect_saved_packet_info *ndspi; @@ -172,7 +172,7 @@ nd_push_buffer(netdissect_options *ndo, u_char *new_buffer, /* * In a given netdissect_options structure: * - *, push the current packet information onto the packet informaton + * push the current packet information onto the packet information * stack; * * given a pointer into the packet and a length past that point in @@ -182,7 +182,7 @@ nd_push_buffer(netdissect_options *ndo, u_char *new_buffer, * set the snapshot end to that new value. */ int -nd_push_snaplen(netdissect_options *ndo, const u_char *bp, u_int newlen) +nd_push_snaplen(netdissect_options *ndo, const u_char *bp, const u_int newlen) { struct netdissect_saved_packet_info *ndspi; u_int snaplen_remaining; @@ -242,7 +242,7 @@ nd_push_snaplen(netdissect_options *ndo, const u_char *bp, u_int newlen) * atop which the current one was pushed, however. */ void -nd_change_snaplen(netdissect_options *ndo, const u_char *bp, u_int newlen) +nd_change_snaplen(netdissect_options *ndo, const u_char *bp, const u_int newlen) { struct netdissect_saved_packet_info *ndspi; const u_char *previous_snapend; @@ -299,3 +299,17 @@ nd_pop_all_packet_info(netdissect_options *ndo) while (ndo->ndo_packet_info_stack != NULL) nd_pop_packet_info(ndo); } + +NORETURN void +nd_trunc_longjmp(netdissect_options *ndo) +{ + longjmp(ndo->ndo_early_end, ND_TRUNCATED); +#ifdef _AIX + /* + * In AIX decorates longjmp() with "#pragma leaves", which tells + * XL C that the function is noreturn, but GCC remains unaware of that and + * yields a "'noreturn' function does return" warning. + */ + ND_UNREACHABLE +#endif /* _AIX */ +}