summaryrefslogtreecommitdiffstats
path: root/extensions/libip6t_REDIRECT.c
diff options
context:
space:
mode:
authorLiping Zhang <liping.zhang@spreadtrum.com>2016-08-28 16:50:48 +0800
committerPablo Neira Ayuso <pablo@netfilter.org>2016-08-30 11:55:55 +0200
commit6deb305b668d0c1f12b5955e76ea5097ca87bf9b (patch)
tree04b399c2f6f18d91f18fff2f90eab516ce19ea90 /extensions/libip6t_REDIRECT.c
parent89391ea5e3afbb5bb84c137c1f78e8c64b07a954 (diff)
extensions: libip[6]t_REDIRECT: use new nft syntax when do xlate
After commit "parser_bison: redirect to :port for consistency with nat/masq statement" in nftables tree, we should recommend the end user to use the new syntax. Before this patch: # iptables-translate -t nat -A PREROUTING -p tcp -j REDIRECT --to-ports 1 nft add rule ip nat PREROUTING ip protocol tcp counter redirect to 1 Apply this patch: # iptables-translate -t nat -A PREROUTING -p tcp -j REDIRECT --to-ports 1 nft add rule ip nat PREROUTING ip protocol tcp counter redirect to :1 Signed-off-by: Liping Zhang <liping.zhang@spreadtrum.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'extensions/libip6t_REDIRECT.c')
-rw-r--r--extensions/libip6t_REDIRECT.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/extensions/libip6t_REDIRECT.c b/extensions/libip6t_REDIRECT.c
index 32f85b96..8e04d2cd 100644
--- a/extensions/libip6t_REDIRECT.c
+++ b/extensions/libip6t_REDIRECT.c
@@ -138,7 +138,7 @@ static int REDIRECT_xlate(struct xt_xlate *xl,
const struct nf_nat_range *range = (const void *)params->target->data;
if (range->flags & NF_NAT_RANGE_PROTO_SPECIFIED) {
- xt_xlate_add(xl, "redirect to %hu",
+ xt_xlate_add(xl, "redirect to :%hu",
ntohs(range->min_proto.tcp.port));
if (range->max_proto.tcp.port != range->min_proto.tcp.port)
xt_xlate_add(xl, "-%hu ",