[tcpdump-workers] [tcpdump] Remove an unnecessicary bit shifting loop (#451)

Michael Richardson mcr at sandelman.ca
Thu Apr 9 10:11:59 EDT 2015

Forwarding to list for wider discussion.

Guy Harris <notifications at github.com> wrote:
    > The bittok2str routines are, for better or worse, currently being used
    > for bitfields that aren't flags, e.g. the "recursion count" field in
    > GRE (or "recursion control", as it's called in RFC 1701). They don't
    > work as one might expect for that, as the routine assumes that each
    > entry refers to something that's either true or false.

    > Should we change the routines to take a table in which each entry
    > contains an optional format string and, if the entry has a format
    > string, the bitfield's value is extracted (including shifting it right
    > appropriately) and printed using the format string, so that the
    > recursion count would show up as recursion count n? Or should we fix
    > the tables so that they only contain single-bit values?

    > — Reply to this email directly or view it on GitHub.


More information about the tcpdump-workers mailing list