Skip to contentSkip to conversation

ip6tables formatting problem

PATCH In review Jamie Strandboge 2 participants 2 messages Feb 6, 2008 – Feb 19, 2008 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ip6tables formatting problem

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/ip6tables.c +2 -2
@@ -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: [email protected]
IRC:   jdstrand
#1 lore raw
Quoted 5 lines · Jamie Strandboge

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:

Quoted 7 lines
# 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'.

Thanks, but this doesn't apply to the current version. Could you send a patch against SVN (or a daily snapshot) please?