summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2021-09-28 14:09:54 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2021-09-29 18:59:44 +0200
commit82f3b6171d0f79d27662266ddd9876d416879dc8 (patch)
tree6697148d86e3763ee1b283e01917bb41eb5bc101 /src
parentd2fb4a860351a9fe77cdab37494328be3268d39b (diff)
evaluate: check for concatenation in set data datatype
When adding this rule with an existing map: add rule nat x y meta l4proto { tcp, udp } dnat ip to ip daddr . th dport map @fwdtoip_th reports a bogus: Error: datatype mismatch: expected IPv4 address, expression has type concatenation of (IPv4 address, internet network service) Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src')
-rw-r--r--src/evaluate.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/evaluate.c b/src/evaluate.c
index b39f4598..f3d7ca42 100644
--- a/src/evaluate.c
+++ b/src/evaluate.c
@@ -3244,7 +3244,8 @@ static bool nat_concat_map(struct eval_ctx *ctx, struct stmt *stmt)
if (expr_evaluate(ctx, &stmt->nat.addr->mappings))
return false;
- if (stmt->nat.addr->mappings->set->data->etype == EXPR_CONCAT) {
+ if (stmt->nat.addr->mappings->set->data->etype == EXPR_CONCAT ||
+ stmt->nat.addr->mappings->set->data->dtype->subtypes) {
stmt->nat.type_flags |= STMT_NAT_F_CONCAT;
return true;
}