diff options
author | Ulrich Drepper <drepper@redhat.com> | 2008-06-13 04:36:35 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2008-06-13 04:36:35 +0000 |
commit | f854efd7224944b15ba3068de28c0d00550f88b7 (patch) | |
tree | 24972dae67b780b685f7d0117b5d1890e7700025 | |
parent | 46f70b3ce849ae22fcf6f81802b2eb622b97723e (diff) | |
download | glibc-f854efd7224944b15ba3068de28c0d00550f88b7.tar glibc-f854efd7224944b15ba3068de28c0d00550f88b7.tar.gz glibc-f854efd7224944b15ba3068de28c0d00550f88b7.tar.bz2 glibc-f854efd7224944b15ba3068de28c0d00550f88b7.zip |
* resolv/nss_dns/dns-host.c (gaih_getanswer): Don't
unconditionally use second gaih_getanswer_slice result.
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | resolv/nss_dns/dns-host.c | 20 |
2 files changed, 14 insertions, 9 deletions
@@ -1,5 +1,8 @@ 2008-06-12 Ulrich Drepper <drepper@redhat.com> + * resolv/nss_dns/dns-host.c (gaih_getanswer): Don't + unconditionally use second gaih_getanswer_slice result. + * sysdeps/posix/getaddrinfo.c (gai_inet): Remove unnecessary test. (getaddrinfo): RES must always be non-NULL. diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c index f99db1c64f..cae077445f 100644 --- a/resolv/nss_dns/dns-host.c +++ b/resolv/nss_dns/dns-host.c @@ -1097,11 +1097,7 @@ gaih_getanswer_slice (const querybuf *answer, int anslen, const char *qname, if (__builtin_expect (buflen < sizeof (struct gaih_addrtuple), 0)) - { - *errnop = ERANGE; - *h_errnop = NETDB_INTERNAL; - return NSS_STATUS_TRYAGAIN; - } + goto too_small; *pat = (struct gaih_addrtuple *) buffer; buffer += sizeof (struct gaih_addrtuple); @@ -1175,11 +1171,17 @@ gaih_getanswer (const querybuf *answer1, int anslen1, const querybuf *answer2, &pat, &buffer, &buflen, errnop, h_errnop, ttlp, &first); - if ((status == NSS_STATUS_SUCCESS || status == NSS_STATUS_NOTFOUND) + if ((status == NSS_STATUS_SUCCESS || status == NSS_STATUS_NOTFOUND + || status == NSS_STATUS_TRYAGAIN) && answer2 != NULL && anslen2 > 0) - status = gaih_getanswer_slice(answer2, anslen2, qname, - &pat, &buffer, &buflen, - errnop, h_errnop, ttlp, &first); + { + enum nss_status status2 = gaih_getanswer_slice(answer2, anslen2, qname, + &pat, &buffer, &buflen, + errnop, h_errnop, ttlp, + &first); + if (status != NSS_STATUS_SUCCESS) + status = status2; + } return status; } |