]> The Tcpdump Group git mirrors - libpcap/commit
Fix the "|" and "&" operators of the "byte" primitive.
authorDenis Ovsienko <[email protected]>
Thu, 27 Mar 2025 17:23:37 +0000 (17:23 +0000)
committerDenis Ovsienko <[email protected]>
Thu, 27 Mar 2025 20:37:43 +0000 (20:37 +0000)
commit82724cc70656f382234e525befc08d90a9b896a5
treef741bc7700a6132fa17df9e1acf1bf0112192f3f
parentf9b31e8068f85b2818aafc426032ba143b8f6b4b
Fix the "|" and "&" operators of the "byte" primitive.

In gen_byteop() the "=", "<" and ">" cases load the required packet byte
into the A register implicitly via gen_load_a(), but the other two cases
need to do it explicitly, otherwise A will hold the previous value and
the ALU instruction will take that as the input.

The bug was introduced in the tcpdump 2.0 release (January 1991, before
libpcap 0.0), which replaced filter.c with gencode.c.
CHANGES
gencode.c
testprogs/TESTrun