From 26b973029647daa5501dac0dcd430b0b467c3479 Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Tue, 26 Jan 2021 16:42:33 +0100 Subject: src: evaluate: reset context maxlen value before prio evaluation unshare -n tests/shell/run-tests.sh tests/shell/testcases/nft-f/0024priority_0 W: [FAILED] tests/shell/testcases/nft-f/0024priority_0: got 1 /dev/stdin:8:47-49: Error: Value 100 exceeds valid range 0-15 type filter hook postrouting priority 100 Reported-by: Andreas Schultz --- src/evaluate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/evaluate.c') diff --git a/src/evaluate.c b/src/evaluate.c index 7d6f55fe..3a91e9ea 100644 --- a/src/evaluate.c +++ b/src/evaluate.c @@ -3789,8 +3789,8 @@ static bool evaluate_priority(struct eval_ctx *ctx, struct prio_spec *prio, int prio_snd; char op; - ctx->ectx.dtype = &priority_type; - ctx->ectx.len = NFT_NAME_MAXLEN * BITS_PER_BYTE; + expr_set_context(&ctx->ectx, &priority_type, NFT_NAME_MAXLEN * BITS_PER_BYTE); + if (expr_evaluate(ctx, &prio->expr) < 0) return false; if (prio->expr->etype != EXPR_VALUE) { -- cgit v1.2.3