From e692b6186ae0989cffa7314985cdf967d2f78dd6 Mon Sep 17 00:00:00 2001 From: Hajimu UMEMOTO Date: Sat, 30 Apr 2005 18:37:35 +0000 Subject: [PATCH] _gethostbynisname() didn't support RES_USE_INET6. --- lib/libc/net/gethostbynis.c | 9 +++++++++ 1 file changed, 9 insertions(+) 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 #include #include +#include /* XXX */ #ifdef YP #include #include @@ -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);