]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Restore _res correctly release/2.11/master
authorUlrich Drepper <drepper@gmail.com>
Mon, 30 May 2011 03:49:49 +0000 (23:49 -0400)
committerPetr Baudis <pasky@ucw.cz>
Sat, 3 Sep 2011 18:31:09 +0000 (20:31 +0200)
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)

ChangeLog
sysdeps/posix/getaddrinfo.c

index da762ca3a6a65e7081ae15087528abf9816bd07e..2e9a5163425178bb9dfca5c961d5742c2a55f175 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-05-29  Ulrich Drepper  <drepper@gmail.com>
+
+       [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  <drepper@gmail.com>
 
        [BZ #12811]
index 0217cc6fd3f8433e19a57975429c03987ab87772..923d6c84ba31261262cc3a029ce4eb076ce0caa9 100644 (file)
@@ -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)
            {