]> 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)
commit956dc817b07ea39ca42f986e9a889acafa53f746
tree2c0ef0d3fbf4beaa4374d2857588192575b64a06
parent48035c7f96f4ae593cbda945ca0f4aca7824cfdc
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