From c68314dd4263575abaed43e052c7e61f6b359040 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Tue, 13 Jul 2021 20:18:27 +0200 Subject: src: infer NAT mapping with concatenation from set If the map is anonymous, infer it from the set elements. Otherwise, the set definition already have an explicit concatenation definition in the data side of the mapping. This update simplifies the NAT mapping syntax with concatenations, e.g. snat ip to ip saddr map { 10.141.11.4 : 192.168.2.3 . 80 } Signed-off-by: Pablo Neira Ayuso --- src/statement.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/statement.c') diff --git a/src/statement.c b/src/statement.c index 6db7e397..06742c04 100644 --- a/src/statement.c +++ b/src/statement.c @@ -673,9 +673,7 @@ static void nat_stmt_print(const struct stmt *stmt, struct output_ctx *octx) break; } - if (stmt->nat.type_flags & STMT_NAT_F_CONCAT) - nft_print(octx, " addr . port"); - else if (stmt->nat.type_flags & STMT_NAT_F_PREFIX) + if (stmt->nat.type_flags & STMT_NAT_F_PREFIX) nft_print(octx, " prefix"); nft_print(octx, " to"); -- cgit v1.2.3