]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
Fix printing of odd ip6tables netmasks (Closes: #103)
authorHarald Welte <laforge@gnumonks.org>
Tue, 24 Jun 2003 18:15:59 +0000 (18:15 +0000)
committerHarald Welte <laforge@gnumonks.org>
Tue, 24 Jun 2003 18:15:59 +0000 (18:15 +0000)
ip6tables.c

index 17bdb4e517d8127bef371e1b8f28a42374f541cb..664b307bbd17d9c1463b1e8627d35493431296a4 100644 (file)
@@ -578,10 +578,13 @@ addr_to_host(const struct in6_addr *addr)
 static char *
 mask_to_numeric(const struct in6_addr *addrp)
 {
-       static char buf[20];
+       static char buf[50+2];
        int l = ipv6_prefix_length(addrp);
-       if (l == -1)
-               return addr_to_numeric(addrp);
+       if (l == -1) {
+               strcpy(buf, "/");
+               strcat(buf, addr_to_numeric(addrp));
+               return buf;
+       }
        sprintf(buf, "/%d", l);
        return buf;
 }