summaryrefslogtreecommitdiff
path: root/toolchain/uClibc/uClibc-0.9.29-fix-resolve-in-etc-hosts.patch
diff options
context:
space:
mode:
authorUlf Samuelsson <ulf.samuelsson@atmel.com>2007-10-12 15:12:55 +0000
committerUlf Samuelsson <ulf.samuelsson@atmel.com>2007-10-12 15:12:55 +0000
commit191d0518b9967a64fa8f947a5b042b4c162752ca (patch)
tree866c8ed5ec8cddc70e905faca952728f70c95b5c /toolchain/uClibc/uClibc-0.9.29-fix-resolve-in-etc-hosts.patch
parent022b1041523e218a44b75bec783dfd2f0d5371df (diff)
Add AVR32 support for uclibc-0-9-29
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.patch46
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
+