tcpdump mailing list archives

Re: [tcpdump] After setjmp/longjmp update


From: Denis Ovsienko via tcpdump-workers <tcpdump-workers () lists tcpdump org>
Date: Thu, 24 Sep 2020 20:57:56 +0100

--- Begin Message --- From: Denis Ovsienko <denis () ovsienko info>
Date: Thu, 24 Sep 2020 20:57:56 +0100
On Fri, 18 Sep 2020 10:25:13 +0200
Francois-Xavier Le Bail <devel.fx.lebail () orange fr> wrote:

[...]
        switch (setjmp(ndo->early_end)) {
        case 0:
                /* Print the packet. */
                (ndo->ndo_if_printer)(ndo, h, sp);
                break;
        case ND_TRUNCATED:
                /* A printer quit because the packet was truncated;
report it */ nd_print_trunc(ndo);
                break;
        case ND_INVALID:
                ND_PRINT(" (invalid)"); /* or calling a function that
do the print */ }
[...]

The switch block should also have a default case, which ideally should
never happen, but if it somehow happens, it should either fail the
current packet safe or just call ndo_error().

-- 
    Denis Ovsienko

--- End Message ---
_______________________________________________
tcpdump-workers mailing list
tcpdump-workers () lists tcpdump org
https://lists.sandelman.ca/mailman/listinfo/tcpdump-workers

Current thread: