summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2015-01-12 10:10:42 +0000
committerPatrick McHardy <kaber@trash.net>2015-01-12 13:29:37 +0000
commit9f2c370b6e8949559950f5390a2515929ecfa9e1 (patch)
tree90a8de895f0362bdb0a484a0b3841f776ca06db8
parent5424f775729a1bc9b72111eb9dfa2b1ffe201e30 (diff)
evaluate: use stmt_evaluate_arg() in all cases
When using a symbolic vmap expression, we fail to verify that the map actually contains verdicts. Use stmt_evaluate_arg() everywhere to fix this. Signed-off-by: Patrick McHardy <kaber@trash.net>
-rw-r--r--src/evaluate.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/evaluate.c b/src/evaluate.c
index 90c87d09..a3484c66 100644
--- a/src/evaluate.c
+++ b/src/evaluate.c
@@ -1135,8 +1135,7 @@ static int stmt_evaluate_arg(struct eval_ctx *ctx, struct stmt *stmt,
static int stmt_evaluate_verdict(struct eval_ctx *ctx, struct stmt *stmt)
{
- expr_set_context(&ctx->ectx, &verdict_type, 0);
- if (expr_evaluate(ctx, &stmt->expr) < 0)
+ if (stmt_evaluate_arg(ctx, stmt, &verdict_type, 0, &stmt->expr) < 0)
return -1;
switch (stmt->expr->ops->type) {
@@ -1625,8 +1624,8 @@ static int stmt_evaluate_redir(struct eval_ctx *ctx, struct stmt *stmt)
static int stmt_evaluate_queue(struct eval_ctx *ctx, struct stmt *stmt)
{
if (stmt->queue.queue != NULL) {
- expr_set_context(&ctx->ectx, &integer_type, 16);
- if (expr_evaluate(ctx, &stmt->queue.queue) < 0)
+ if (stmt_evaluate_arg(ctx, stmt, &integer_type, 16,
+ &stmt->queue.queue) < 0)
return -1;
if (!expr_is_constant(stmt->queue.queue))
return expr_error(ctx->msgs, stmt->queue.queue,