]> git.ipfire.org Git - thirdparty/nftables.git/commit
evaluate: move interval flag compat check after set key evaluation
authorFlorian Westphal <fw@strlen.de>
Mon, 17 Mar 2025 11:56:36 +0000 (12:56 +0100)
committerFlorian Westphal <fw@strlen.de>
Tue, 18 Mar 2025 13:25:31 +0000 (14:25 +0100)
commit3e50cd6b063d64c2e72b0e32bc36dd5a22f75c06
treeda5112bee769a78ee0ad0aed264efdafc5f294e5
parentceab53cee4999debd64ab29414b918746209ba7b
evaluate: move interval flag compat check after set key evaluation

Without this, included bogon asserts with:
BUG: unhandled key type 13
nft: src/intervals.c:73: setelem_expr_to_range: Assertion `0' failed.

... because we no longer evaluate set->key/data.

Move the check to the tail of the function, right before assiging
set->existing_set, so that set->key has been evaluated.

Fixes: ceab53cee499 ("evaluate: don't allow merging interval set/map with non-interval one")
Signed-off-by: Florian Westphal <fw@strlen.de>
Reviewed-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/evaluate.c
tests/shell/testcases/bogons/nft-f/invalid_data_expr_type_range_value_2_assert [new file with mode: 0644]