svn commit: branches/uClibc_0_9_29/libc/inet
vapier at uclibc.org
vapier at uclibc.org
Sat Jan 5 09:44:01 PST 2008
Author: vapier
Date: 2008-01-05 09:44:01 -0800 (Sat, 05 Jan 2008)
New Revision: 20776
Log:
Merge r20099 by vapier from trunk:
This patch will fix a problem when the same host is defined with both IPv4 and
IPv6 entries in /etc/hosts. Previous only the first of these host would work,
as uClibc would read the /etc/hosts file from top to bottom, failing if the
first hit did not match the IP type.
Now uClibc will continue reading, even if the first correct entry name, but wrong IP
type fails. Thus, allowing a second correct entry name with correct IP type
will result in a name resolve.
Signed-off-by: Hans-Christian Egtvedt <hcegtvedt at atmel.com>
Modified:
branches/uClibc_0_9_29/libc/inet/resolv.c
Changeset:
Modified: branches/uClibc_0_9_29/libc/inet/resolv.c
===================================================================
--- branches/uClibc_0_9_29/libc/inet/resolv.c 2008-01-05 17:42:50 UTC (rev 20775)
+++ branches/uClibc_0_9_29/libc/inet/resolv.c 2008-01-05 17:44:01 UTC (rev 20776)
@@ -1652,9 +1652,15 @@
ret=NETDB_SUCCESS;
#endif /* __UCLIBC_HAS_IPV6__ */
} else {
- DPRINTF("Error\n");
+ /* continue parsing in the hope the user has multiple
+ * host types listed in the database like so:
+ * <ipv4 addr> host
+ * <ipv6 addr> host
+ * If looking for an IPv6 addr, don't bail when we got the IPv4
+ */
+ DPRINTF("Error: Found host but diff network type\n");
ret=TRY_AGAIN;
- break; /* bad ip address */
+ continue;
}
if (action!=GETHOSTENT) {
More information about the uClibc-cvs
mailing list