From ca709b5784c982de12d6eab361cfc9c900aec4c7 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Fri, 5 May 2023 17:39:08 +0200 Subject: 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 --- iptables/nft-shared.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'iptables/nft-shared.c') 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; } } -- cgit v1.2.3