]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
ip6tables: don't print out /128
authorPhil Oester <kernel@linuxace.com>
Thu, 20 Jun 2013 20:11:38 +0000 (16:11 -0400)
committerPablo Neira Ayuso <pablo@soleta.eu>
Mon, 8 Jul 2013 16:52:58 +0000 (18:52 +0200)
Similar to how iptables does not print /32 on IPv4 addresses, ip6tables
should not print out /128 on IPv6 addresses.

Signed-off-by: Phil Oester <kernel@linuxace.com>
Signed-off-by: Pablo Neira Ayuso <pablo@soleta.eu>
libxtables/xtables.c

index ebc77b6c3143a9c246dd85d3a4ce2fcf874b7e31..ef5bc0726203ac61aad7f4c482494f35be96c8ee 100644 (file)
@@ -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;
 }