]> git.ipfire.org Git - thirdparty/nftables.git/commit
optimize: more robust statement merge with vmap
authorPablo Neira Ayuso <pablo@netfilter.org>
Thu, 3 Mar 2022 12:06:59 +0000 (13:06 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 3 Mar 2022 14:54:27 +0000 (15:54 +0100)
commit3de1dbd2da8a76ddd2d1d9fcd7e469eb848f0d00
treee16709ed82e5875694cbbbd7f69debdeba7a254d
parent99eb46969f3d7ccd37899f2755055fe7511c46b0
optimize: more robust statement merge with vmap

Check expressions that are expected on the rhs rather than using a
catch-all default case.

Actually, lists and sets need to be their own routine, because this
needs the set element key expression to be merged.

This is a follow up to 99eb46969f3d ("optimize: fix vmap with anonymous
sets").

Fixes: 1542082e259b ("optimize: merge same selector with different verdict into verdict map")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/optimize.c
tests/shell/testcases/optimizations/dumps/merge_stmts_vmap.nft
tests/shell/testcases/optimizations/merge_stmts_vmap