]> The Tcpdump Group git mirrors - libpcap/commit
If BPF_STMT or BPF_JUMP is defined, undefine them before redefining them.
authorGuy Harris <[email protected]>
Mon, 25 Jan 2021 00:13:50 +0000 (16:13 -0800)
committerGuy Harris <[email protected]>
Mon, 25 Jan 2021 01:23:57 +0000 (17:23 -0800)
commit041fe47c6126400cf5453a91770c983b5a022aaf
tree691ece35647d85b7b0ae82d1ea0fe2008a5de11c
parent4350ead6939af0ec0dded3be9c913e00c8e22f7f
If BPF_STMT or BPF_JUMP is defined, undefine them before redefining them.

Do that instead of just not defining the BPF stuff if __LINUX_FILTER_H__
is defined.  That way, our definitions override the <linux/filter.h>
definitions.  If those differ from our definitions, we want our
definitions, at least when building the BPF code generator, so that, for
example, we support the modulo and XOR operators.  (If the kernel
doesn't support them, the attempt to set the kernel filter will fail if
we use BPF_MOD or BPF_XOR, and we'll fall back on doing userland
filtering.)

This should address GitHub issue #987.

(cherry picked from commit 2abff2bc2dbd2be3888330e9ce0df298dd441d8a)
pcap/bpf.h