summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorume <ume@FreeBSD.org>2005-04-30 19:28:31 +0000
committerume <ume@FreeBSD.org>2005-04-30 19:28:31 +0000
commitebe4b8304d164a842cc96bcc863c9321a37f57ff (patch)
tree118b5923c45222be426e700e5d3cfb98e6b86305 /lib
parent91b46d9bcd3b01ebee06a42d92d3095cd5288743 (diff)
downloadFreeBSD-src-ebe4b8304d164a842cc96bcc863c9321a37f57ff.zip
FreeBSD-src-ebe4b8304d164a842cc96bcc863c9321a37f57ff.tar.gz
handling RES_USE_INET6 better.
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/net/gethostbynis.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/libc/net/gethostbynis.c b/lib/libc/net/gethostbynis.c
index ca1a9a5..45aed33 100644
--- a/lib/libc/net/gethostbynis.c
+++ b/lib/libc/net/gethostbynis.c
@@ -50,7 +50,7 @@ __FBSDID("$FreeBSD$");
#ifdef YP
static int
_gethostbynis(const char *name, char *map, int af, struct hostent *he,
- struct hostent_data *hed)
+ struct hostent_data *hed, int mapped)
{
char *p, *bp, *ep;
char *cp, **q;
@@ -101,7 +101,7 @@ _gethostbynis(const char *name, char *map, int af, struct hostent *he,
addrok = inet_aton(result, (struct in_addr *)hed->host_addr);
if (addrok != 1)
break;
- if (_res.options & RES_USE_INET6) {
+ if (mapped) {
_map_v4v6_address((char *)hed->host_addr,
(char *)hed->host_addr);
af = AF_INET6;
@@ -172,7 +172,8 @@ _gethostbynisname_r(const char *name, int af, struct hostent *he,
map = "ipnodes.byname";
break;
}
- return _gethostbynis(name, map, af, he, hed);
+ return _gethostbynis(name, map, af, he, hed,
+ _res.options & RES_USE_INET6);
}
static int
@@ -192,7 +193,7 @@ _gethostbynisaddr_r(const char *addr, int len, int af, struct hostent *he,
}
if (inet_ntop(af, addr, numaddr, sizeof(numaddr)) == NULL)
return -1;
- return _gethostbynis(numaddr, map, af, he, hed);
+ return _gethostbynis(numaddr, map, af, he, hed, 0);
}
#endif /* YP */
OpenPOWER on IntegriCloud