]> The Tcpdump Group git mirrors - libpcap/commit
Mind all-zeroes mask in gen_mcmp().
authorDenis Ovsienko <[email protected]>
Fri, 28 Mar 2025 23:18:28 +0000 (23:18 +0000)
committerDenis Ovsienko <[email protected]>
Tue, 8 Apr 2025 10:38:16 +0000 (11:38 +0100)
commit9f9d545905b6579147bd720f7d6c27b4e8dd35ba
tree2862677f20b99575d7bfb80936411ff125e5650a
parent3d1a9f5c9ff8c50d27b81fbcedf1b43fafa90370
Mind all-zeroes mask in gen_mcmp().

In this function mask 0 is an edge case, handle it appropriately and
take a shortcut to either gen_true() or gan_false().

All tested optimized filter programs remain the same.  IPv4 netmask /0
and IPv6 netmasks shorter than /96 now have shorter unoptimized filter
programs: the number of always-true comparisons stays the same, but each
takes two instructions instead of three.
gencode.c
testprogs/TESTrun