netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ip6tables: don't print out /128
@ 2013-06-20 20:11 Phil Oester
  2013-07-08  2:26 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 4+ messages in thread
From: Phil Oester @ 2013-06-20 20:11 UTC (permalink / raw)
  To: netfilter-devel; +Cc: pablo

[-- Attachment #1: Type: text/plain, Size: 175 bytes --]

Similar to how iptables does not print /32 on IPv4 addresses, ip6tables
should not print out /128 on IPv6 addresses.

Phil

Signed-off-by: Phil Oester <kernel@linuxace.com>



[-- Attachment #2: patch-no_128 --]
[-- Type: text/plain, Size: 448 bytes --]

diff --git a/libxtables/xtables.c b/libxtables/xtables.c
index ebc77b6..ef5bc07 100644
--- a/libxtables/xtables.c
+++ b/libxtables/xtables.c
@@ -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;
 }
 

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-07-08 16:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-20 20:11 [PATCH] ip6tables: don't print out /128 Phil Oester
2013-07-08  2:26 ` Pablo Neira Ayuso
2013-07-08  4:19   ` Phil Oester
2013-07-08 16:55     ` Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).