]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
extensions: NETMAP: add ' to:' prefix when printing NETMAP target
authorFlorian Westphal <fw@strlen.de>
Wed, 1 Jun 2016 10:59:26 +0000 (12:59 +0200)
committerFlorian Westphal <fw@strlen.de>
Wed, 1 Jun 2016 11:02:43 +0000 (13:02 +0200)
NETMAP .print function doesn't insert the ' ' character needed to seperate
earlier output from the target network, i.e. iptables -L prints
something like

2.2.2.5-2.2.2.103.3.3.64/28
instead of
2.2.2.5-2.2.2.10 3.3.3.64/28

Add a ' to:' prefix just like we do for S/DNAT targets.

Closes https://bugzilla.netfilter.org/show_bug.cgi?id=1070.

Signed-off-by: Florian Westphal <fw@strlen.de>
extensions/libip6t_NETMAP.c
extensions/libipt_NETMAP.c

index a4df70ee8ff4a2eb74a2d7fd6ba5b97773a015ec..8d2913fe68b542ae5a68edf006158f8dc226089c 100644 (file)
@@ -58,7 +58,7 @@ static void NETMAP_print(const void *ip, const struct xt_entry_target *target,
        int bits;
 
        a = r->min_addr.in6;
-       printf("%s", xtables_ip6addr_to_numeric(&a));
+       printf(" to:%s", xtables_ip6addr_to_numeric(&a));
        for (i = 0; i < 4; i++)
                a.s6_addr32[i] = ~(r->min_addr.ip6[i] ^ r->max_addr.ip6[i]);
        bits = xtables_ip6mask_to_cidr(&a);
index dee7b01bcb3d78e5b82d7f0664ab78bb036d0ced..4932c96354b77a8572bdf3f44536163e29fc707f 100644 (file)
@@ -71,7 +71,7 @@ static void NETMAP_print(const void *ip, const struct xt_entry_target *target,
        int bits;
 
        a.s_addr = r->min_ip;
-       printf("%s", xtables_ipaddr_to_numeric(&a));
+       printf(" to:%s", xtables_ipaddr_to_numeric(&a));
        a.s_addr = ~(r->min_ip ^ r->max_ip);
        bits = netmask2bits(a.s_addr);
        if (bits < 0)