summaryrefslogtreecommitdiff
path: root/toolchain/uClibc/patches
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
commiteeb61522b53ffd943268104a7019d62202865787 (patch)
tree9419d8a7724ff492be70b0690b12ba079a3b4afd /toolchain/uClibc/patches
parentb420fccd92ffb8efe257451d385e2db8babb61d2 (diff)
downloadmtk-20170518-eeb61522b53ffd943268104a7019d62202865787.zip
mtk-20170518-eeb61522b53ffd943268104a7019d62202865787.tar.gz
mtk-20170518-eeb61522b53ffd943268104a7019d62202865787.tar.bz2
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.
SVN-Revision: 6217
Diffstat (limited to 'toolchain/uClibc/patches')
-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 0000000..38f6d3e
--- /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) {