summaryrefslogtreecommitdiffstats
path: root/iptables/nft-shared.c
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2023-05-05 17:39:08 +0200
committerPhil Sutter <phil@nwl.cc>2023-08-11 15:56:38 +0200
commitca709b5784c982de12d6eab361cfc9c900aec4c7 (patch)
treef9050ead4c83cffa9f933cb988ad1cba330d5163 /iptables/nft-shared.c
parent402b9b3c07c8192be3bfc0191fbf56401e26a003 (diff)
nft: Introduce and use bool nft_handle::compat
If set, create rules using compat expressions where possible and disable the bitwise expression avoidance introduced in 323259001d617 ("nft: Optimize class-based IP prefix matches"). Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'iptables/nft-shared.c')
-rw-r--r--iptables/nft-shared.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/iptables/nft-shared.c b/iptables/nft-shared.c
index 34ca9d16..5e0ca00e 100644
--- a/iptables/nft-shared.c
+++ b/iptables/nft-shared.c
@@ -198,7 +198,7 @@ void add_addr(struct nft_handle *h, struct nftnl_rule *r,
for (i = 0; i < len; i++) {
if (m[i] != 0xff) {
- bitwise = m[i] != 0;
+ bitwise = h->compat || m[i] != 0;
break;
}
}