]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
evaluate: process concat expressions when used as mapped-to expr
authorFlorian Westphal <fw@strlen.de>
Mon, 24 Feb 2020 00:03:20 +0000 (01:03 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 24 Feb 2020 09:58:04 +0000 (10:58 +0100)
Needed to avoid triggering the 'dtype->size == 0' tests.
Evaluation will build a new concatenated type that holds the
size of the aggregate.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/evaluate.c

index ae629abe247a78b496b83d5d73ce005336f6220e..7a70eff95998b93b1fbe864dd0a75e46b53075cc 100644 (file)
@@ -3368,6 +3368,10 @@ static int set_evaluate(struct eval_ctx *ctx, struct set *set)
                        return set_error(ctx, set, "map definition does not "
                                         "specify mapping data type");
 
+               if (set->data->etype == EXPR_CONCAT &&
+                   expr_evaluate_concat(ctx, &set->data, false) < 0)
+                       return -1;
+
                if (set->data->len == 0 && set->data->dtype->type != TYPE_VERDICT)
                        return set_key_data_error(ctx, set,
                                                  set->data->dtype, type);