summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2016-04-27 12:29:45 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2016-05-13 18:54:33 +0200
commit0ce93baa9f4db1acc393b185662b506aebbb759a (patch)
tree8171e79298024786596bd6f0ff8fb4ac59ed55b4 /src
parent7b1d8ddf896f966970de847ae48fe8444ed29eb2 (diff)
set: allow non-constant implicit set declarations
Currently all implicitly declared sets are marked as constant. The flow statement needs to implicitly declare non-constant sets, so instead of unconditionally marking the set as constant, only do so if the declaring expression is itself a constant set. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src')
-rw-r--r--src/evaluate.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/evaluate.c b/src/evaluate.c
index 3afb8ead..c5f87a19 100644
--- a/src/evaluate.c
+++ b/src/evaluate.c
@@ -96,7 +96,7 @@ static struct expr *implicit_set_declaration(struct eval_ctx *ctx,
struct handle h;
set = set_alloc(&expr->location);
- set->flags = SET_F_CONSTANT | SET_F_ANONYMOUS | expr->set_flags;
+ set->flags = SET_F_ANONYMOUS | expr->set_flags;
set->handle.set = xstrdup(set->flags & SET_F_MAP ? "map%d" : "set%d");
set->keytype = keytype;
set->keylen = keylen;
@@ -1075,6 +1075,8 @@ static int expr_evaluate_set(struct eval_ctx *ctx, struct expr **expr)
set->set_flags |= SET_F_INTERVAL;
}
+ set->set_flags |= SET_F_CONSTANT;
+
set->dtype = ctx->ectx.dtype;
set->len = ctx->ectx.len;
set->flags |= EXPR_F_CONSTANT;