--- Begin Message ---
On 17/09/2020 16:15, Denis Ovsienko via tcpdump-workers wrote:
> On Sat, 5 Sep 2020 18:20:42 +0200
> Francois-Xavier Le Bail via tcpdump-workers
> <tcpdump-workers@lists.tcpdump.org> wrote:
> 
>> 2) Process all the truncated cases with:
>> ndo->ndo_ll_hdr_len = 0;
>> longjmp(ndo->ndo_truncated, 1);
>> (With a new macro, like 'ND_TRUNCATED' or 'ND_IS_TRUNCATED')
> The master branch now has a change along these lines. Whilst preparing
> changes to a couple decoders based on that (still work in progress), I
> managed to make some observations, will post as soon as it all looks
> good and makes sense.

Should we have something like:

        if (setjmp(ndo->early_end) == 0) {
                /* Print the packet. */
                (ndo->ndo_if_printer)(ndo, h, sp);
        } else {
                switch (ndo->early_end_reason) {
                case TRUNCATED:
                        /* A printer quit because the packet was truncated; 
report it */
                        nd_print_trunc(ndo);
                        break;
                case INVALID:
                        ...
                }
        }

(ndo->ndo_truncated -> ndo->early_end and ndo->early_end_reason = 
TRUNCATED/INVALID/other?

-- 
Francois-Xavier

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

Reply via email to