summaryrefslogtreecommitdiffstats
path: root/contrib/ntp/libntp/socktoa.c
diff options
context:
space:
mode:
authorroberto <roberto@FreeBSD.org>2008-08-22 15:58:00 +0000
committerroberto <roberto@FreeBSD.org>2008-08-22 15:58:00 +0000
commitb85c7169a740b2edf0106ad59fdaa1b0160f823c (patch)
tree2b9fb7f64eacb322e95695e412c923e97ba33e88 /contrib/ntp/libntp/socktoa.c
parent1d197cfe9feac6bc29537d8e53c30b6435937b95 (diff)
parent7a6072eb585696f8856cd498c3fd194cf49f14c6 (diff)
downloadFreeBSD-src-b85c7169a740b2edf0106ad59fdaa1b0160f823c.zip
FreeBSD-src-b85c7169a740b2edf0106ad59fdaa1b0160f823c.tar.gz
Merge ntpd & friends 4.2.4p5 from vendor/ntp/dist into head. Next commit
will update usr.sbin/ntp to match this. MFC after: 2 weeks
Diffstat (limited to 'contrib/ntp/libntp/socktoa.c')
-rw-r--r--contrib/ntp/libntp/socktoa.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/contrib/ntp/libntp/socktoa.c b/contrib/ntp/libntp/socktoa.c
index 34de784..fb41b22 100644
--- a/contrib/ntp/libntp/socktoa.c
+++ b/contrib/ntp/libntp/socktoa.c
@@ -6,7 +6,6 @@
#include <sys/types.h>
#include <sys/socket.h>
-#include <netdb.h>
#include <netinet/in.h>
#include <arpa/inet.h>
@@ -31,10 +30,14 @@ socktoa(
LIB_GETBUF(buffer);
- if (sock == NULL) printf("null");
+ if (sock == NULL)
+ strcpy(buffer, "null");
+ else
+ {
- switch(sock->ss_family) {
+ switch(sock->ss_family) {
+ default:
case AF_INET :
inet_ntop(AF_INET, &GET_INADDR(*sock), buffer,
LIB_BUFLENGTH);
@@ -43,6 +46,11 @@ socktoa(
case AF_INET6 :
inet_ntop(AF_INET6, &GET_INADDR6(*sock), buffer,
LIB_BUFLENGTH);
+#if 0
+ default:
+ strcpy(buffer, "unknown");
+#endif
+ }
}
return buffer;
}
OpenPOWER on IntegriCloud