]> git.ipfire.org Git - thirdparty/nftables.git/commit
optimize: select merge criteria based on candidates rules
authorPablo Neira Ayuso <pablo@netfilter.org>
Mon, 6 Feb 2023 13:18:10 +0000 (14:18 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 6 Feb 2023 16:52:39 +0000 (17:52 +0100)
commit299823d46b6d0c49040d81ee3eb0f37b3b0520ea
treed1ccb274147f7a9c4554ca390e48781c248b78c6
parente1dfd5cc4c46514a84dd8a2063b45517b596e1ca
optimize: select merge criteria based on candidates rules

Select the merge criteria based on the statements that are used
in the candidate rules, instead of using the list of statements
in the given chain.

Update tests to include a rule with a verdict, which triggers
the bug described in the bugzilla ticket.

Closes: https://bugzilla.netfilter.org/show_bug.cgi?id=1657
Fixes: 0a6dbfce6dc3 ("optimize: merge nat rules with same selectors into map")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/optimize.c
tests/shell/testcases/optimizations/dumps/merge_nat.nft
tests/shell/testcases/optimizations/merge_nat