Skip to contentSkip to conversation

evaluate: bogus error when refering to existing non-base chain

PATCH New Pablo Neira Ayuso 1 participant 1 message Jul 16, 2019 netfilter

lore
Share & tools
lore

Pablo Neira Ayuso

author maintainer
#0 lore raw

PATCH v2 1/1 evaluate: bogus error when refering to existing non-base chain

add rule ip testNEW test6 jump test8

                                ^^^^^

Error: invalid verdict chain expression value

---
v2: keep the check for the expression type in place.

@Charles: would you mind to test this one and confirm crash does not happen
anymore?

 src/evaluate.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
src/evaluate.c +3 -6
index f95f42e1067a..ed3ca484ad22 100644
@@ -1987,12 +1987,9 @@ static int stmt_evaluate_verdict(struct eval_ctx *ctx, struct stmt *stmt)
 		if (stmt->expr->chain != NULL) {
 			if (expr_evaluate(ctx, &stmt->expr->chain) < 0)
 				return -1;
-			if ((stmt->expr->chain->etype != EXPR_SYMBOL &&
-			    stmt->expr->chain->etype != EXPR_VALUE) ||
-			    stmt->expr->chain->symtype != SYMBOL_VALUE) {
-				return stmt_error(ctx, stmt,
-						  "invalid verdict chain expression %s\n",
-						  expr_name(stmt->expr->chain));
+			if (stmt->expr->chain->etype != EXPR_VALUE) {
+				return expr_error(ctx->msgs, stmt->expr->chain,
+						  "not a value expression");
 			}
 		}
 		break;
Signature · 1 line
2.11.0