summaryrefslogtreecommitdiffstats
path: root/ip6tables.c
diff options
context:
space:
mode:
authorlaforge <laforge>2003-06-24 18:15:59 +0000
committerlaforge <laforge>2003-06-24 18:15:59 +0000
commitc2f000b273a18b132edff49510b585d24060a68a (patch)
tree0a6496c74023d29a8d17545a6c590c9074f58f91 /ip6tables.c
parent0bac74ad534cb1b3204b7771e6a58c4771166bd8 (diff)
Fix printing of odd ip6tables netmasks (Closes: #103)
Diffstat (limited to 'ip6tables.c')
-rw-r--r--ip6tables.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/ip6tables.c b/ip6tables.c
index 17bdb4e..664b307 100644
--- a/ip6tables.c
+++ b/ip6tables.c
@@ -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;
}