diff options
author | Florian Westphal <fw@strlen.de> | 2024-01-11 18:14:15 +0100 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2024-01-11 21:34:05 +0100 |
commit | 1d03ab5267bdbc7c0bcb041efaad42a462fdeb5f (patch) | |
tree | b6cd8fadf7eeca035f17255f8c819cf17f67d7fa /src/evaluate.c | |
parent | 666018e71ebb5df376b1b013c1ca859eaed66f1a (diff) |
evaluate: tproxy: move range error checks after arg evaluation
Testing for range before evaluation will still crash us later during
netlink linearization, prefixes turn into ranges, symbolic expression
might hide a range/prefix.
So move this after the argument has been evaluated.
Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'src/evaluate.c')
-rw-r--r-- | src/evaluate.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/evaluate.c b/src/evaluate.c index 197c82c2..d11bed01 100644 --- a/src/evaluate.c +++ b/src/evaluate.c @@ -4132,22 +4132,22 @@ static int stmt_evaluate_tproxy(struct eval_ctx *ctx, struct stmt *stmt) return err; if (stmt->tproxy.addr != NULL) { - if (stmt->tproxy.addr->etype == EXPR_RANGE) - return stmt_error(ctx, stmt, "Address ranges are not supported for tproxy."); - err = stmt_evaluate_addr(ctx, stmt, &stmt->tproxy.family, &stmt->tproxy.addr); - if (err < 0) return err; + + if (stmt->tproxy.addr->etype == EXPR_RANGE) + return stmt_error(ctx, stmt, "Address ranges are not supported for tproxy."); } if (stmt->tproxy.port != NULL) { - if (stmt->tproxy.port->etype == EXPR_RANGE) - return stmt_error(ctx, stmt, "Port ranges are not supported for tproxy."); err = nat_evaluate_transport(ctx, stmt, &stmt->tproxy.port); if (err < 0) return err; + + if (stmt->tproxy.port->etype == EXPR_RANGE) + return stmt_error(ctx, stmt, "Port ranges are not supported for tproxy."); } return 0; |