summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHajimu UMEMOTO <ume@FreeBSD.org>2005-04-30 18:37:35 +0000
committerHajimu UMEMOTO <ume@FreeBSD.org>2005-04-30 18:37:35 +0000
commite692b6186ae0989cffa7314985cdf967d2f78dd6 (patch)
treed6c90c9fd6a0ec51270434caa3f4e017dccaedb2
parent507e86aa470fdd0f198a1cc9d5911d2a8caad673 (diff)
Notes
-rw-r--r--lib/libc/net/gethostbynis.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/libc/net/gethostbynis.c b/lib/libc/net/gethostbynis.c
index 34fd2895688e..ca1a9a56ad87 100644
--- a/lib/libc/net/gethostbynis.c
+++ b/lib/libc/net/gethostbynis.c
@@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$");
#include <string.h>
#include <stdarg.h>
#include <nsswitch.h>
+#include <resolv.h> /* XXX */
#ifdef YP
#include <rpc/rpc.h>
#include <rpcsvc/yp_prot.h>
@@ -98,6 +99,14 @@ _gethostbynis(const char *name, char *map, int af, struct hostent *he,
switch (af) {
case AF_INET:
addrok = inet_aton(result, (struct in_addr *)hed->host_addr);
+ if (addrok != 1)
+ break;
+ if (_res.options & RES_USE_INET6) {
+ _map_v4v6_address((char *)hed->host_addr,
+ (char *)hed->host_addr);
+ af = AF_INET6;
+ size = NS_IN6ADDRSZ;
+ }
break;
case AF_INET6:
addrok = inet_pton(af, result, hed->host_addr);