ip6tables: don't print out /128
PATCH 1/1 ip6tables: don't print out /128
Similar to how iptables does not print /32 on IPv4 addresses, ip6tables should not print out /128 on IPv6 addresses.
Phil
libxtables/xtables.c +5 -1
@@ -1597,7 +1597,11 @@ const char *xtables_ip6mask_to_numeric(const struct in6_addr *addrp)strcat (buf,xtables_ip6addr_to_numeric (addrp));return buf; } -sprintf (buf,"/%d" , l); +/* we don't want to see "/128" */ +if (l ==128 ) +return "" ; +else +sprintf (buf,"/%d" , l);return buf; }
Pablo Neira Ayuso
maintainerHi Phil,
Quoted 2 lines · Phil Oester
Similar to how iptables does not print /32 on IPv4 addresses, ip6tables should not print out /128 on IPv6 addresses.
I just look at the source of old iptables releases (1.4.11) and it displays the /32 with iptables -L. I prefer if we restore that behaviour, ie. we get it back to display /32, for historial reasons.
Quoted 3 lines · Pablo Neira Ayuso
I just look at the source of old iptables releases (1.4.11) and it displays the /32 with iptables -L. I prefer if we restore that behaviour, ie. we get it back to display /32, for historial reasons.
That does not appear to be correct.
# ./iptables-multi main -V iptables v1.4.10
# ./iptables-multi main -L foo
Chain foo (0 references)
target prot opt source destination
all -- 1.2.3.4 anywhereQuoted 1 line
From what I can tell, the comment
/* we don't want to see "/32" */
has existed in the tree since at least 3/2000.
Phil
Pablo Neira Ayuso
maintainerQuoted 16 lines · Phil Oester
Quoted 3 lines · Pablo Neira Ayuso
I just look at the source of old iptables releases (1.4.11) and it displays the /32 with iptables -L. I prefer if we restore that behaviour, ie. we get it back to display /32, for historial reasons.
That does not appear to be correct.
# ./iptables-multi main -V iptables v1.4.10# ./iptables-multi main -L foo Chain foo (0 references) target prot opt source destination all -- 1.2.3.4 anywhere
Quoted 5 lines
From what I can tell, the comment
/* we don't want to see "/32" */has existed in the tree since at least 3/2000.
You're right, I was looking at the wrong place in the code. I have applied this patch. Thanks.