netfilter: nf_tables: Enable fast nft_cmp for inverted matches
authorPhil Sutter <phil@nwl.cc>
Fri, 2 Oct 2020 13:50:56 +0000 (15:50 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Sun, 4 Oct 2020 19:08:32 +0000 (21:08 +0200)
commit5f48846daf3321f8a1f8aa99cd6173e3980b7a29
tree2c0ef0d3fbf4beaa4374d2857588192575b64a06
parentab6c41eefd46b92e4f5bcdbbc6c1ea39ed148274
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>
include/net/netfilter/nf_tables_core.h
net/netfilter/nf_tables_core.c
net/netfilter/nft_cmp.c