From 89391ea5e3afbb5bb84c137c1f78e8c64b07a954 Mon Sep 17 00:00:00 2001 From: Liping Zhang Date: Sun, 28 Aug 2016 16:50:47 +0800 Subject: extensions: libip[6]t_SNAT/DNAT: use the new nft syntax when do xlate After commit "src: add 'to' for snat and dnat" in nftables tree, we should recommend the end user to use the new syntax. Before this patch: # iptables-translate -t nat -A POSTROUTING -j SNAT --to-source 1.1.1.1 nft add rule ip nat POSTROUTING counter snat 1.1.1.1 # ip6tables-translate -t nat -A PREROUTING -j DNAT --to-destination 2001::1 nft add rule ip6 nat PREROUTING counter dnat 2001::1 Apply this patch: # iptables-translate -t nat -A POSTROUTING -j SNAT --to-source 1.1.1.1 nft add rule ip nat POSTROUTING counter snat to 1.1.1.1 # ip6tables-translate -t nat -A PREROUTING -j DNAT --to-destination 2001::1 nft add rule ip6 nat PREROUTING counter dnat to 2001::1 Signed-off-by: Liping Zhang Signed-off-by: Pablo Neira Ayuso --- extensions/libipt_DNAT.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'extensions/libipt_DNAT.c') diff --git a/extensions/libipt_DNAT.c b/extensions/libipt_DNAT.c index 78907198..a14d16f7 100644 --- a/extensions/libipt_DNAT.c +++ b/extensions/libipt_DNAT.c @@ -271,7 +271,7 @@ static int DNAT_xlate(struct xt_xlate *xl, const char *sep = " "; for (i = 0; i < info->mr.rangesize; i++) { - xt_xlate_add(xl, "dnat "); + xt_xlate_add(xl, "dnat to "); print_range_xlate(&info->mr.range[i], xl); if (info->mr.range[i].flags & NF_NAT_RANGE_PROTO_RANDOM) { xt_xlate_add(xl, " random"); -- cgit v1.2.3