evaluate: reject set definition with no key
Pablo Neira Ayuso
maintainerPATCH 1/1 evaluate: reject set definition with no key
tests/shell/testcases/bogons/nft-f/set_definition_with_no_key_assert
BUG: unhandled key type 2 nft: src/intervals.c:59: setelem_expr_to_range: Assertion `0' failed.
This patch adds a new unit tests/shell courtesy of Florian Westphal.
Fixes 3975430b12d9 ("src: expand table command before evaluation")
Reported-by Florian Westphal <[email protected]>
Signed-off-by Pablo Neira Ayuso <[email protected]>
--- src/evaluate.c | 4 ++++ 1 file changed, 4 insertions(+)
src/evaluate.c +4 -0
@@ -4693,6 +4693,10 @@ static int set_evaluate(struct eval_ctx *ctx, struct set *set)struct stmt *stmt;const char *type; +if (set->key ==NULL ) +return set_error (ctx, set,"%s definition does not specify key" , + set->flags &NFT_SET_MAP ?"map" :"set" ); +if (!set_is_anonymous (set->flags)) { table = table_cache_find(&ctx->nft->cache.table_cache, set->handle.table.name,
Signature · 1 line
2.30.2
Florian Westphal
maintainerQuoted 9 lines · Pablo Neira Ayuso
tests/shell/testcases/bogons/nft-f/set_definition_with_no_key_assert
BUG: unhandled key type 2 nft: src/intervals.c:59: setelem_expr_to_range: Assertion `0' failed.This patch adds a new unit tests/shell courtesy of Florian Westphal.
Fixes 3975430b12d9 ("src: expand table command before evaluation")Reported-by Florian Westphal <[email protected]>Signed-off-by Pablo Neira Ayuso <[email protected]>
Looks saner than what I did, thanks Pablo.