diff options
author | Florian Westphal <fw@strlen.de> | 2021-01-26 16:42:33 +0100 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2021-01-26 16:44:09 +0100 |
commit | 26b973029647daa5501dac0dcd430b0b467c3479 (patch) | |
tree | 39352bc0f2a771832dc386a3244eb6366f5a337b /src/evaluate.c | |
parent | 6e6ef00028f1c9b8091246d178836e4d3f072e93 (diff) |
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 <andreas.schultz@travelping.com
Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'src/evaluate.c')
-rw-r--r-- | src/evaluate.c | 4 |
1 files changed, 2 insertions, 2 deletions
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) { |