forked from pool/glibc
170 lines
5.0 KiB
Diff
170 lines
5.0 KiB
Diff
2008-11-26 Ulrich Drepper <drepper@redhat.com>
|
|
|
|
* sysdeps/posix/getaddrinfo.c (getaddrinfo): Only restrict search
|
|
to IPv4 or IPv6 if an interface has been found.
|
|
|
|
--- sysdeps/posix/getaddrinfo.c 30 Jul 2008 19:14:22 -0000 1.136
|
|
+++ sysdeps/posix/getaddrinfo.c 3 Dec 2008 07:04:10 -0000 1.139
|
|
@@ -2108,7 +2110,7 @@ getaddrinfo (const char *name, const cha
|
|
{
|
|
/* If we haven't seen both IPv4 and IPv6 interfaces we can
|
|
narrow down the search. */
|
|
- if (! seen_ipv4 || ! seen_ipv6)
|
|
+ if ((! seen_ipv4 || ! seen_ipv6) && (seen_ipv4 || seen_ipv6))
|
|
{
|
|
local_hints = *hints;
|
|
local_hints.ai_family = seen_ipv4 ? PF_INET : PF_INET6;
|
|
|
|
|
|
2008-12-02 Ulrich Drepper <drepper@redhat.com>
|
|
|
|
* sysdeps/posix/getaddrinfo.c (gaih_inet): In case we use
|
|
gethostbyname4_r, we don't have a separate IPv6 status, so copy
|
|
the no_data variable.
|
|
|
|
--- sysdeps/posix/getaddrinfo.c 30 Jul 2008 19:14:22 -0000 1.136
|
|
+++ sysdeps/posix/getaddrinfo.c 3 Dec 2008 07:04:10 -0000 1.139
|
|
@@ -733,6 +733,8 @@ gaih_inet (const char *name, const struc
|
|
tmpbuflen, 2 * tmpbuflen);
|
|
}
|
|
|
|
+ no_inet6_data = no_data;
|
|
+
|
|
if (status == NSS_STATUS_SUCCESS)
|
|
{
|
|
if ((req->ai_flags & AI_CANONNAME) != 0 && canon == NULL)
|
|
|
|
|
|
2008-12-02 Ulrich Drepper <drepper@redhat.com>
|
|
|
|
* resolv/res_init.c (__res_vinit): Initialize nscount to zero.
|
|
|
|
* resolv/res_init.c (__res_vinit): Fill in IPv4 name server
|
|
information at the correct index.
|
|
|
|
2008-12-07 Ulrich Drepper <drepper@redhat.com>
|
|
|
|
* resolv/res_init.c (__res_vinit): Always assign to statp->nscount
|
|
after reading name server list.
|
|
|
|
--- resolv/res_init.c 7 Apr 2008 17:20:25 -0000 1.47
|
|
+++ resolv/res_init.c 8 Dec 2008 03:59:05 -0000 1.50
|
|
@@ -183,7 +183,7 @@ __res_vinit(res_state statp, int preinit
|
|
#endif
|
|
statp->nsaddr.sin_family = AF_INET;
|
|
statp->nsaddr.sin_port = htons(NAMESERVER_PORT);
|
|
- statp->nscount = 1;
|
|
+ statp->nscount = 0;
|
|
statp->ndots = 1;
|
|
statp->pfcode = 0;
|
|
statp->_vcsock = -1;
|
|
@@ -314,9 +314,9 @@ __res_vinit(res_state statp, int preinit
|
|
cp++;
|
|
if ((*cp != '\0') && (*cp != '\n')
|
|
&& __inet_aton(cp, &a)) {
|
|
- statp->nsaddr_list[nserv].sin_addr = a;
|
|
- statp->nsaddr_list[nserv].sin_family = AF_INET;
|
|
- statp->nsaddr_list[nserv].sin_port =
|
|
+ statp->nsaddr_list[nservall].sin_addr = a;
|
|
+ statp->nsaddr_list[nservall].sin_family = AF_INET;
|
|
+ statp->nsaddr_list[nservall].sin_port =
|
|
htons(NAMESERVER_PORT);
|
|
nserv++;
|
|
#ifdef _LIBC
|
|
@@ -420,8 +420,7 @@ __res_vinit(res_state statp, int preinit
|
|
continue;
|
|
}
|
|
}
|
|
- if (nserv > 1)
|
|
- statp->nscount = nserv;
|
|
+ statp->nscount = nserv;
|
|
#ifdef _LIBC
|
|
if (nservall - nserv > 0) {
|
|
statp->_u._ext.nscount6 = nservall - nserv;
|
|
|
|
|
|
2008-12-02 Ulrich Drepper <drepper@redhat.com>
|
|
|
|
* resolv/nss_dns/dns-host.c (_nss_dns_gethostbyname3_r): Recognize
|
|
ESRCH return value.
|
|
(_nss_dns_gethostbyname4_r): Likewise.
|
|
|
|
--- resolv/nss_dns/dns-host.c 12 Nov 2008 07:52:20 -0000 1.54
|
|
+++ resolv/nss_dns/dns-host.c 3 Dec 2008 07:09:26 -0000 1.55
|
|
@@ -198,8 +198,14 @@ _nss_dns_gethostbyname3_r (const char *n
|
|
1024, &host_buffer.ptr, NULL, NULL, NULL);
|
|
if (n < 0)
|
|
{
|
|
- status = (errno == ECONNREFUSED
|
|
- ? NSS_STATUS_UNAVAIL : NSS_STATUS_NOTFOUND);
|
|
+ if (errno == ESRCH)
|
|
+ {
|
|
+ status = NSS_STATUS_TRYAGAIN;
|
|
+ h_errno = TRY_AGAIN;
|
|
+ }
|
|
+ else
|
|
+ status = (errno == ECONNREFUSED
|
|
+ ? NSS_STATUS_UNAVAIL : NSS_STATUS_NOTFOUND);
|
|
*h_errnop = h_errno;
|
|
if (h_errno == TRY_AGAIN)
|
|
*errnop = EAGAIN;
|
|
@@ -304,8 +310,14 @@ _nss_dns_gethostbyname4_r (const char *n
|
|
&ans2p, &nans2p, &resplen2);
|
|
if (n < 0)
|
|
{
|
|
- status = (errno == ECONNREFUSED
|
|
- ? NSS_STATUS_UNAVAIL : NSS_STATUS_NOTFOUND);
|
|
+ if (errno == ESRCH)
|
|
+ {
|
|
+ status = NSS_STATUS_TRYAGAIN;
|
|
+ h_errno = TRY_AGAIN;
|
|
+ }
|
|
+ else
|
|
+ status = (errno == ECONNREFUSED
|
|
+ ? NSS_STATUS_UNAVAIL : NSS_STATUS_NOTFOUND);
|
|
*herrnop = h_errno;
|
|
if (h_errno == TRY_AGAIN)
|
|
*errnop = EAGAIN;
|
|
|
|
|
|
2008-12-29 Ulrich Drepper <drepper@redhat.com>
|
|
|
|
* resolv/res_init.c (__res_vinit): Count all servers in statp->nscount.
|
|
|
|
diff -u -r1.50 -r1.51
|
|
--- resolv/res_init.c 2008/12/08 03:59:05 1.50
|
|
+++ resolv/res_init.c 2008/12/29 19:53:31 1.51
|
|
@@ -420,7 +420,7 @@
|
|
continue;
|
|
}
|
|
}
|
|
- statp->nscount = nserv;
|
|
+ statp->nscount = nservall;
|
|
#ifdef _LIBC
|
|
if (nservall - nserv > 0) {
|
|
statp->_u._ext.nscount6 = nservall - nserv;
|
|
|
|
|
|
2009-01-16 Petr Baudis <pasky@suse.cz>
|
|
|
|
* resolv/res_libc (__res_maybe_init): Call __res_vinit()
|
|
even if we currently have zero nscount.
|
|
|
|
diff --git a/resolv/res_libc.c b/resolv/res_libc.c
|
|
index 8af57f7..810fbc8 100644
|
|
--- resolv/res_libc.c
|
|
+++ resolv/res_libc.c
|
|
@@ -96,10 +96,9 @@ __res_maybe_init (res_state resp, int preinit)
|
|
{
|
|
if (resp->options & RES_INIT) {
|
|
if (__res_initstamp != resp->_u._ext.initstamp) {
|
|
- if (resp->nscount > 0) {
|
|
+ if (resp->nscount > 0)
|
|
__res_iclose (resp, true);
|
|
- return __res_vinit (resp, 1);
|
|
- }
|
|
+ return __res_vinit (resp, 1);
|
|
}
|
|
return 0;
|
|
} else if (preinit) {
|