aboutsummaryrefslogtreecommitdiff
path: root/libc/inet/resolv.c
diff options
context:
space:
mode:
authorGravatar Eric Andersen <andersen@codepoet.org>2007-02-02 00:25:22 +0000
committerGravatar Eric Andersen <andersen@codepoet.org>2007-02-02 00:25:22 +0000
commitdaf938cbca9ec764418b3f74f91394d08967b282 (patch)
tree14b828870ba2e3c4bb46351f88960d459844dfe5 /libc/inet/resolv.c
parentece06b6aafcfbab3e4cb05e594f3ac748344941f (diff)
downloaduClibc-daf938cbca9ec764418b3f74f91394d08967b282.tar.gz
uClibc-daf938cbca9ec764418b3f74f91394d08967b282.tar.bz2
fix obvious bug in ipv4/ipv6 resolving. When not using AF_INET,
gethostbyname2_r tries to resolve an ipv6 address from /etc/hosts using get_hosts_byname_r, but with AF_INET instead of the supplied address family. This returns ipv4 addresses marked as ipv6 ones. Fix from nbd.
Diffstat (limited to 'libc/inet/resolv.c')
-rw-r--r--libc/inet/resolv.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c
index 6d918c02f..1fbee2c35 100644
--- a/libc/inet/resolv.c
+++ b/libc/inet/resolv.c
@@ -2064,7 +2064,7 @@ int gethostbyname2_r(const char *name, int family,
int old_errno = errno; /* Save the old errno and reset errno */
__set_errno(0); /* to check for missing /etc/hosts. */
- if ((i=__get_hosts_byname_r(name, AF_INET, result_buf,
+ if ((i=__get_hosts_byname_r(name, family, result_buf,
buf, buflen, result, h_errnop))==0)
return i;
switch (*h_errnop) {