]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitee11a891cef5bdcd534e6cd1d845f1f98be401eb
tree2c0ef0d3fbf4beaa4374d2857588192575b64a06
parente49407932aaa2c2893f62ea91bb9ae2bc32f4330
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