about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@redhat.com>2011-06-30 06:33:32 -0400
committerAndreas Schwab <schwab@redhat.com>2011-06-30 13:15:03 +0200
commit01d737a4700a7f8971ba1adc70fcbff8f028f981 (patch)
treef1b691e7e9c2a3f8156d06c65608b342b95ee346
parent3ad68d2c0b2346fcd77d53059c005f7af25f8fcd (diff)
downloadglibc-01d737a4700a7f8971ba1adc70fcbff8f028f981.tar.gz
glibc-01d737a4700a7f8971ba1adc70fcbff8f028f981.tar.xz
glibc-01d737a4700a7f8971ba1adc70fcbff8f028f981.zip
Make sure RES_USE_INET6 is always restored
(cherry picked from commit 89f654c57b3b9a6aee480e25e37f88f06c898901)
-rw-r--r--ChangeLog5
-rw-r--r--sysdeps/posix/getaddrinfo.c4
2 files changed, 9 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 31d2047edf..534ac2c094 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-06-30  Andreas Schwab  <schwab@redhat.com>
+
+	* sysdeps/posix/getaddrinfo.c (gaih_inet): Make sure RES_USE_INET6
+	is always restored.
+
 2011-06-28  Ulrich Drepper  <drepper@gmail.com>
 
 	[BZ #12935]
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
index 6b7423cda1..27ce75edc1 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
@@ -828,6 +828,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
 	      tmpbuf = malloc (tmpbuflen);
 	      if (tmpbuf == NULL)
 		{
+		  _res.options |= old_res_options & RES_USE_INET6;
 		  result = -EAI_MEMORY;
 		  goto free_and_return;
 		}
@@ -872,6 +873,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
 						2 * tmpbuflen);
 			  if (newp == NULL)
 			    {
+			      _res.options |= old_res_options & RES_USE_INET6;
 			      result = -EAI_MEMORY;
 			      goto free_and_return;
 			    }
@@ -991,6 +993,8 @@ gaih_inet (const char *name, const struct gaih_service *service,
 				      canonbuf = malloc (max_fqdn_len);
 				      if (canonbuf == NULL)
 					{
+					  _res.options
+					    |= old_res_options & RES_USE_INET6;
 					  result = -EAI_MEMORY;
 					  goto free_and_return;
 					}