[RFC PATCH nft 1/6] set: allow non-constant implicit set declarations

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 src/evaluate.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/evaluate.c b/src/evaluate.c
index 7842471..f53ba5e 100644
--- a/src/evaluate.c
+++ b/src/evaluate.c
@@ -90,7 +90,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;
@@ -887,6 +887,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;
-- 
2.4.3

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux