]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
fix ip6tables dest address printing
authorJamie Strandboge <jamie@ubuntu.com>
Fri, 16 May 2008 12:52:12 +0000 (14:52 +0200)
committerPatrick McHardy <kaber@trash.net>
Fri, 16 May 2008 12:52:12 +0000 (14:52 +0200)
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=464244

ip6tables improperly displays the destination address when the address
is longer than 18 characters.  Here is example output:
...
DROP       tcp      2001:db8::/32        2001:db8:3:4:5:6:7:8/128tcp spt:25
...

Proper formatting should have a space between '2001:db8:3:4:5:6:7:8/128'
and 'tcp'.

Signed-off-by: Jamie Strandboge <jamie@ubuntu.com>
Signed-off-by: Lawrence J. Lane <ljlane@debian.org>
Signed-off-by: Patrick McHardy <kaber@trash.net>
ip6tables.c

index 9b68fba3e27e18ed95e620d4ce3cf1c1ba59aa19..8e135f16b07ba50738e4b28499004a52ecc49644 100644 (file)
@@ -810,14 +810,14 @@ print_firewall(const struct ip6t_entry *fw,
        fputc(fw->ipv6.invflags & IP6T_INV_DSTIP ? '!' : ' ', stdout);
        if (!memcmp(&fw->ipv6.dmsk, &in6addr_any, sizeof in6addr_any)
            && !(format & FMT_NUMERIC))
-               printf(FMT("%-19s","-> %s"), "anywhere");
+               printf(FMT("%-19s ","-> %s"), "anywhere");
        else {
                if (format & FMT_NUMERIC)
                        sprintf(buf, "%s", ip6addr_to_numeric(&fw->ipv6.dst));
                else
                        sprintf(buf, "%s", ip6addr_to_anyname(&fw->ipv6.dst));
                strcat(buf, ip6mask_to_numeric(&fw->ipv6.dmsk));
-               printf(FMT("%-19s","-> %s"), buf);
+               printf(FMT("%-19s ","-> %s"), buf);
        }
 
        if (format & FMT_NOTABLE)