summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorHakan Olsson <ho@cvs.openbsd.org>1999-09-03 13:52:35 +0000
committerHakan Olsson <ho@cvs.openbsd.org>1999-09-03 13:52:35 +0000
commit30af2905c3d217ed35bfdf507d777f1695b39a87 (patch)
treefba4b07291d30869752aa724cdbe8c61afd0e4f0 /sys
parentca6c031ba2f96dfd33331129d4c75bcab1c9d98b (diff)
inet_ntoa4 should manage 4-calls, not just 2
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet/ip_ipsp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/netinet/ip_ipsp.c b/sys/netinet/ip_ipsp.c
index ef4966372bb..fb4268b3c8c 100644
--- a/sys/netinet/ip_ipsp.c
+++ b/sys/netinet/ip_ipsp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_ipsp.c,v 1.53 1999/08/10 11:35:26 ho Exp $ */
+/* $OpenBSD: ip_ipsp.c,v 1.54 1999/09/03 13:52:34 ho Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
@@ -1355,9 +1355,9 @@ inet_ntoa4(struct in_addr ina)
{
static char buf[4][4 * sizeof "123"];
unsigned char *ucp = (unsigned char *) &ina;
- static int i = 1;
+ static int i = 3;
- i = (i + 1) % 2;
+ i = (i + 1) % 4;
sprintf(buf[i], "%d.%d.%d.%d", ucp[0] & 0xff, ucp[1] & 0xff,
ucp[2] & 0xff, ucp[3] & 0xff);
return (buf[i]);