stmt_evaluate_reject passes cmd->expr argument but its never used. Signed-off-by: Florian Westphal <fw@xxxxxxxxx> --- src/evaluate.c | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/src/evaluate.c b/src/evaluate.c index 0db3d80f8b56..507b1c86cafc 100644 --- a/src/evaluate.c +++ b/src/evaluate.c @@ -3624,8 +3624,7 @@ static int reject_payload_gen_dependency_family(struct eval_ctx *ctx, return 1; } -static int stmt_reject_gen_dependency(struct eval_ctx *ctx, struct stmt *stmt, - struct expr *expr) +static int stmt_reject_gen_dependency(struct eval_ctx *ctx, struct stmt *stmt) { struct expr *payload = NULL; struct stmt *nstmt; @@ -3705,8 +3704,7 @@ static int stmt_evaluate_reject_inet_family(struct eval_ctx *ctx, return 0; } -static int stmt_evaluate_reject_inet(struct eval_ctx *ctx, struct stmt *stmt, - struct expr *expr) +static int stmt_evaluate_reject_inet(struct eval_ctx *ctx, struct stmt *stmt) { struct proto_ctx *pctx = eval_proto_ctx(ctx); const struct proto_desc *desc; @@ -3717,7 +3715,7 @@ static int stmt_evaluate_reject_inet(struct eval_ctx *ctx, struct stmt *stmt, return -1; if (stmt->reject.type == NFT_REJECT_ICMPX_UNREACH) return 0; - if (stmt_reject_gen_dependency(ctx, stmt, expr) < 0) + if (stmt_reject_gen_dependency(ctx, stmt) < 0) return -1; return 0; } @@ -3772,8 +3770,7 @@ static int stmt_evaluate_reject_bridge_family(struct eval_ctx *ctx, return 0; } -static int stmt_evaluate_reject_bridge(struct eval_ctx *ctx, struct stmt *stmt, - struct expr *expr) +static int stmt_evaluate_reject_bridge(struct eval_ctx *ctx, struct stmt *stmt) { struct proto_ctx *pctx = eval_proto_ctx(ctx); const struct proto_desc *desc; @@ -3789,13 +3786,12 @@ static int stmt_evaluate_reject_bridge(struct eval_ctx *ctx, struct stmt *stmt, return -1; if (stmt->reject.type == NFT_REJECT_ICMPX_UNREACH) return 0; - if (stmt_reject_gen_dependency(ctx, stmt, expr) < 0) + if (stmt_reject_gen_dependency(ctx, stmt) < 0) return -1; return 0; } -static int stmt_evaluate_reject_family(struct eval_ctx *ctx, struct stmt *stmt, - struct expr *expr) +static int stmt_evaluate_reject_family(struct eval_ctx *ctx, struct stmt *stmt) { struct proto_ctx *pctx = eval_proto_ctx(ctx); @@ -3806,7 +3802,7 @@ static int stmt_evaluate_reject_family(struct eval_ctx *ctx, struct stmt *stmt, case NFPROTO_IPV6: switch (stmt->reject.type) { case NFT_REJECT_TCP_RST: - if (stmt_reject_gen_dependency(ctx, stmt, expr) < 0) + if (stmt_reject_gen_dependency(ctx, stmt) < 0) return -1; break; case NFT_REJECT_ICMPX_UNREACH: @@ -3821,11 +3817,11 @@ static int stmt_evaluate_reject_family(struct eval_ctx *ctx, struct stmt *stmt, break; case NFPROTO_BRIDGE: case NFPROTO_NETDEV: - if (stmt_evaluate_reject_bridge(ctx, stmt, expr) < 0) + if (stmt_evaluate_reject_bridge(ctx, stmt) < 0) return -1; break; case NFPROTO_INET: - if (stmt_evaluate_reject_inet(ctx, stmt, expr) < 0) + if (stmt_evaluate_reject_inet(ctx, stmt) < 0) return -1; break; } @@ -3958,8 +3954,6 @@ static int stmt_evaluate_reset(struct eval_ctx *ctx, struct stmt *stmt) static int stmt_evaluate_reject(struct eval_ctx *ctx, struct stmt *stmt) { - struct expr *expr = ctx->cmd->expr; - if (stmt->reject.icmp_code < 0) { if (stmt_evaluate_reject_default(ctx, stmt) < 0) return -1; @@ -3971,7 +3965,7 @@ static int stmt_evaluate_reject(struct eval_ctx *ctx, struct stmt *stmt) return -1; } - return stmt_evaluate_reject_family(ctx, stmt, expr); + return stmt_evaluate_reject_family(ctx, stmt); } static int nat_evaluate_family(struct eval_ctx *ctx, struct stmt *stmt) -- 2.49.0