From: Ulrich Drepper Date: Mon, 30 May 2011 03:49:49 +0000 (-0400) Subject: Restore _res correctly X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=df79688ef6f6c746ecb4cc2e212780832e2f9c87;p=thirdparty%2Fglibc.git Restore _res correctly getaddrinfo works around the resolver functionality to avoid automatic IPv6 lookups. The restoring didn't allow for the resolver to set additional bits in _res. (cherry picked from commit 7ae22829afb2b4ca531d1c00437d428f55d59341) --- diff --git a/ChangeLog b/ChangeLog index da762ca3a6a..2e9a5163425 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2011-05-29 Ulrich Drepper + + [BZ #12350] + * sysdeps/posix/getaddrinfo.c (gethosts): Restore only RES_USE_IENT6 + bit from old_res_options. + (gaih_inet): Likewise. + 2011-05-28 Ulrich Drepper [BZ #12811] diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c index 0217cc6fd3f..923d6c84ba3 100644 --- a/sysdeps/posix/getaddrinfo.c +++ b/sysdeps/posix/getaddrinfo.c @@ -207,7 +207,7 @@ gaih_inet_serv (const char *servicename, const struct gaih_typeproto *tp, if (herrno == NETDB_INTERNAL) \ { \ __set_h_errno (herrno); \ - _res.options = old_res_options; \ + _res.options |= old_res_options & RES_USE_INET6; \ return -EAI_SYSTEM; \ } \ if (herrno == TRY_AGAIN) \ @@ -842,7 +842,7 @@ gaih_inet (const char *name, const struct gaih_service *service, nip = nip->next; } - _res.options = old_res_options; + _res.options |= old_res_options & RES_USE_INET6; if (no_data != 0 && no_inet6_data != 0) {