svn commit: branches/uClibc_0_9_28/libc/inet

andersen at uclibc.org andersen at uclibc.org
Fri Feb 2 00:25:22 UTC 2007


Author: andersen
Date: 2007-02-01 16:25:22 -0800 (Thu, 01 Feb 2007)
New Revision: 17702

Log:
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.


Modified:
   branches/uClibc_0_9_28/libc/inet/resolv.c


Changeset:
Modified: branches/uClibc_0_9_28/libc/inet/resolv.c
===================================================================
--- branches/uClibc_0_9_28/libc/inet/resolv.c	2007-02-02 00:23:55 UTC (rev 17701)
+++ branches/uClibc_0_9_28/libc/inet/resolv.c	2007-02-02 00:25:22 UTC (rev 17702)
@@ -2064,7 +2064,7 @@
 		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) {




More information about the uClibc-cvs mailing list