summaryrefslogtreecommitdiff
path: root/include/net
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2020-10-02 16:50:56 +0300
committerPablo Neira Ayuso <pablo@netfilter.org>2020-10-04 22:08:32 +0300
commit5f48846daf3321f8a1f8aa99cd6173e3980b7a29 (patch)
tree2c0ef0d3fbf4beaa4374d2857588192575b64a06 /include/net
parentab6c41eefd46b92e4f5bcdbbc6c1ea39ed148274 (diff)
downloadlinux-5f48846daf3321f8a1f8aa99cd6173e3980b7a29.tar.xz
netfilter: nf_tables: Enable fast nft_cmp for inverted matches
Add a boolean indicating NFT_CMP_NEQ. To include it into the match decision, it is sufficient to XOR it with the data comparison's result. While being at it, store the mask that is calculated during expression init and free the eval routine from having to recalculate it each time. Signed-off-by: Phil Sutter <phil@nwl.cc> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/netfilter/nf_tables_core.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/net/netfilter/nf_tables_core.h b/include/net/netfilter/nf_tables_core.h
index 78516de14d31..df2d91c814cb 100644
--- a/include/net/netfilter/nf_tables_core.h
+++ b/include/net/netfilter/nf_tables_core.h
@@ -25,8 +25,10 @@ void nf_tables_core_module_exit(void);
struct nft_cmp_fast_expr {
u32 data;
+ u32 mask;
enum nft_registers sreg:8;
u8 len;
+ bool inv;
};
struct nft_immediate_expr {