summaryrefslogtreecommitdiffstats
path: root/tests/shell/testcases/nft-f/dumps/0025empty_dynset_0.nft
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2023-09-16 15:42:48 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2023-11-03 12:23:37 +0100
commitc6b749958d54ff74af39e0271b5f615dc14f743c (patch)
treef8f8e74173dba9906a41eb323854b1693dfe3c4b /tests/shell/testcases/nft-f/dumps/0025empty_dynset_0.nft
parent672224d14b837b7a875f22d4bed06711947c9387 (diff)
evaluate: expand sets and maps before evaluation
commit 56c90a2dd2eb9cb63a6d74d0f5ce8075bef3895b upstream. 3975430b12d9 ("src: expand table command before evaluation") moved ruleset expansion before evaluation, except for sets and maps. For sets and maps there is still a post_expand() phase. This patch moves sets and map expansion to allocate an independent CMD_OBJ_SETELEMS command to add elements to named set and maps which is evaluated, this consolidates the ruleset expansion to happen always before the evaluation step for all objects, except for anonymous sets and maps. This approach avoids an interference with the set interval code which detects overlaps and merges of adjacents ranges. This set interval routine uses set->init to maintain a cache of existing elements. Then, the post_expand() phase incorrectly expands set->init cache and it triggers a bogus ENOENT errors due to incorrect bytecode (placing element addition before set creation) in combination with user declared sets using the flat syntax notation. Since the evaluation step (coming after the expansion) creates implicit/anonymous sets and maps, those are not expanded anymore. These anonymous sets still need to be evaluated from set_evaluate() path and the netlink bytecode generation path, ie. do_add_set(), needs to deal with anonymous sets. Note that, for named sets, do_add_set() does not use set->init. Such content is part of the existing cache, and the CMD_OBJ_SETELEMS command is responsible for adding elements to named sets. Fixes: 3975430b12d9 ("src: expand table command before evaluation") Reported-by: Jann Haber <jannh@selfnet.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'tests/shell/testcases/nft-f/dumps/0025empty_dynset_0.nft')
0 files changed, 0 insertions, 0 deletions