about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@gmail.com>2011-05-29 23:49:49 -0400
committerPetr Baudis <pasky@ucw.cz>2011-09-03 20:31:09 +0200
commitdf79688ef6f6c746ecb4cc2e212780832e2f9c87 (patch)
tree6f7765c253bb6405b7776b8d793b8115b7a0772e
parent07c65bd7b3f8aaed2e6e567d4b1a932893e8838a (diff)
downloadglibc-release/2.11/master.tar.gz
glibc-release/2.11/master.tar.xz
glibc-release/2.11/master.zip
Restore _res correctly release/2.11/master
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)
-rw-r--r--ChangeLog7
-rw-r--r--sysdeps/posix/getaddrinfo.c4
2 files changed, 9 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index da762ca3a6..2e9a516342 100644
--- 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]
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
index 0217cc6fd3..923d6c84ba 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)
 	    {