[PATCH] ip6tables formatting problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I am sending this here as bugzilla.netfilter.org is down. I am not
subscribed to the list, so please CC me on replies.

ip6tables improperly displays the destination address when the address
is longer than 18 characters.  Here is example output:
# ip6tables -L -n
...
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'.

Here is a patch to do just that:
--- iptables-1.3.8.0debian1.orig/iptables/ip6tables.c
+++ iptables-1.3.8.0debian1/iptables/ip6tables.c
@@ -1427,14 +1427,14 @@
        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", addr_to_numeric(&(fw->ipv6.dst)));
                else
                        sprintf(buf, "%s", addr_to_anyname(&(fw->ipv6.dst)));
                strcat(buf, mask_to_numeric(&(fw->ipv6.dmsk)));
-               printf(FMT("%-19s","-> %s"), buf);
+               printf(FMT("%-19s ","-> %s"), buf);
        }

        if (format & FMT_NOTABLE)

Jamie Strandboge

--
Email: jamie@xxxxxxxxxxxxxx
IRC:   jdstrand

-
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux