Skip to contentSkip to conversation

evaluate: incorrect usage of stmt_binary_error() in reject

PATCH New Pablo Neira Ayuso 1 participant 1 message Feb 9, 2021 netfilter

lore
Share & tools
lore

Pablo Neira Ayuso

author maintainer
#0 lore raw

PATCH 1/1 evaluate: incorrect usage of stmt_binary_error() in reject

Don't pass ctx->pctx.protocol[PROTO_BASE_LL_HDR] to stmt_binary_error(), it's not useful for the error reporting as location is not available.

---
 src/evaluate.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
src/evaluate.c +2 -3
index 030bbde4ab2c..782a5bca98bb 100644
@@ -2729,9 +2729,8 @@ static int stmt_evaluate_reject_bridge(struct eval_ctx *ctx, struct stmt *stmt,
 
 	desc = ctx->pctx.protocol[PROTO_BASE_LL_HDR].desc;
 	if (desc != &proto_eth && desc != &proto_vlan && desc != &proto_netdev)
-		return stmt_binary_error(ctx,
-					 &ctx->pctx.protocol[PROTO_BASE_LL_HDR],
-					 stmt, "unsupported link layer protocol");
+		return __stmt_binary_error(ctx, &stmt->location, NULL,
+					   "cannot reject from this link layer protocol");
 
 	desc = ctx->pctx.protocol[PROTO_BASE_NETWORK_HDR].desc;
 	if (desc != NULL &&
Signature · 1 line
2.20.1