evaluate: reject set references in set elements
Florian Westphal
maintainerPATCH 1/1 evaluate: reject set references in set elements
given
table filter {
set local {
type iface_index
elements = { lo }
}
chain input {
type filter hook input priority 0;
iif { @lan, } accept; }
}
nft BUG()s. I don't see how we could support sets-in-set; add a sanity check and error out instead.
Signed-off-by Florian Westphal <[email protected]>
--- src/evaluate.c | 5 +++++ 1 file changed, 5 insertions(+)
src/evaluate.c +5 -0
@@ -920,6 +920,11 @@ static int expr_evaluate_set(struct eval_ctx *ctx, struct expr **expr)if (list_member_evaluate (ctx, &i) <0 )return -1 ; +if (i->ops->type ==EXPR_SET_ELEM && + i->key->ops->type ==EXPR_SET_REF ) +return expr_error (ctx->msgs, i, +"Set reference cannot be part of another set" ); +if (!expr_is_constant (i))return expr_error (ctx->msgs, i,"Set member is not constant" );
Signature · 1 line
2.4.10
Quoted 10 lines · Florian Westphal
given
table filter {
set local { type iface_index elements = { lo } } chain input { type filter hook input priority 0; iif { @lan, } accept;
Quoted 7 lines
}
}nft BUG()s. I don't see how we could support sets-in-set; add a sanity check and error out instead.
Signed-off-by Florian Westphal <[email protected]>