diff options
Diffstat (limited to 'toolchain/uClibc/uClibc-0.9.29-fix-resolve-in-etc-hosts.patch')
-rw-r--r-- | toolchain/uClibc/uClibc-0.9.29-fix-resolve-in-etc-hosts.patch | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/toolchain/uClibc/uClibc-0.9.29-fix-resolve-in-etc-hosts.patch b/toolchain/uClibc/uClibc-0.9.29-fix-resolve-in-etc-hosts.patch new file mode 100644 index 000000000..a64bd4cda --- /dev/null +++ b/toolchain/uClibc/uClibc-0.9.29-fix-resolve-in-etc-hosts.patch @@ -0,0 +1,46 @@ +From 91cb4bb00e4d9463c0d41015152daa4b39acf762 Mon Sep 17 00:00:00 2001 +From: Hans-Christian Egtvedt <hcegtvedt@atmel.com> +Date: Tue, 18 Sep 2007 10:15:05 +0200 +Subject: [PATCH] Fix resolve when identical IPv4 and IPv6 hosts are defined in /etc/hosts + +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@atmel.com> +--- + libc/inet/resolv.c | 6 +++--- + 1 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c +index f4e6cac..9cdc3fe 100644 +--- a/libc/inet/resolv.c ++++ b/libc/inet/resolv.c +@@ -1643,7 +1643,7 @@ int attribute_hidden __read_etc_hosts_r(FILE * fp, const char * name, int type, + *result=result_buf; + ret=NETDB_SUCCESS; + #ifdef __UCLIBC_HAS_IPV6__ +- } else if (type == AF_INET6 && inet_pton(AF_INET6, alias[0], in6) > 0) { ++ } else if (type == AF_INET6 && inet_pton(AF_INET6, alias[0], in6) > 0) { + DPRINTF("Found INET6\n"); + addr_list6[0] = in6; + addr_list6[1] = 0; +@@ -1658,8 +1658,8 @@ int attribute_hidden __read_etc_hosts_r(FILE * fp, const char * name, int type, + } else { + DPRINTF("Error\n"); + ret=TRY_AGAIN; +- break; /* bad ip address */ +- } ++ continue; /* bad ip address, keep searching */ ++ } + + if (action!=GETHOSTENT) { + fclose(fp); +-- +1.5.2.5 + |