aboutsummaryrefslogtreecommitdiffstats
path: root/toolchain
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2007-01-27 15:13:06 +0000
committerFelix Fietkau <nbd@openwrt.org>2007-01-27 15:13:06 +0000
commit5987213ee80097f217a72172654515659f5073ea (patch)
tree0ea2b2c7833db3266a08214944c50c2c47ca6a62 /toolchain
parent7449be1dd96a7933536d10c4c6d41d7af114c37b (diff)
downloadupstream-5987213ee80097f217a72172654515659f5073ea.tar.gz
upstream-5987213ee80097f217a72172654515659f5073ea.tar.bz2
upstream-5987213ee80097f217a72172654515659f5073ea.zip
Fix 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. git-svn-id: svn://svn.openwrt.org/openwrt/trunk@6217 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'toolchain')
-rw-r--r--toolchain/uClibc/patches/200-ipv6_hosts_resolve.patch12
1 files changed, 12 insertions, 0 deletions
diff --git a/toolchain/uClibc/patches/200-ipv6_hosts_resolve.patch b/toolchain/uClibc/patches/200-ipv6_hosts_resolve.patch
new file mode 100644
index 0000000000..38f6d3eb34
--- /dev/null
+++ b/toolchain/uClibc/patches/200-ipv6_hosts_resolve.patch
@@ -0,0 +1,12 @@
+diff -pur uClibc.old/libc/inet/resolv.c uClibc.dev/libc/inet/resolv.c
+--- uClibc.old/libc/inet/resolv.c 2005-08-18 00:49:41.000000000 +0200
++++ uClibc.dev/libc/inet/resolv.c 2007-01-27 15:33:39.689171960 +0100
+@@ -2083,7 +2083,7 @@ int gethostbyname2_r(const char *name, i
+ 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) {