summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/libkern/inet_ntoa.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/sys/libkern/inet_ntoa.c b/sys/libkern/inet_ntoa.c
index 558188c..25cfff1 100644
--- a/sys/libkern/inet_ntoa.c
+++ b/sys/libkern/inet_ntoa.c
@@ -48,3 +48,17 @@ inet_ntoa(struct in_addr ina)
return buf;
}
+char *
+inet_ntoa_r(struct in_addr ina, char *buf)
+{
+ unsigned char *ucp = (unsigned char *)&ina;
+
+ sprintf(buf, "%d.%d.%d.%d",
+ ucp[0] & 0xff,
+ ucp[1] & 0xff,
+ ucp[2] & 0xff,
+ ucp[3] & 0xff);
+ return buf;
+}
+
+
OpenPOWER on IntegriCloud