about summary refs log tree commit diff
path: root/sysdeps/posix/getaddrinfo.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@gmail.com>2011-05-29 23:49:49 -0400
committerUlrich Drepper <drepper@gmail.com>2011-05-29 23:49:49 -0400
commit7ae22829afb2b4ca531d1c00437d428f55d59341 (patch)
treeea2a495f13c93dd2ce2b45a319f8118974a0a30f /sysdeps/posix/getaddrinfo.c
parent553149f603fa2897052af45c676020558d7138a6 (diff)
downloadglibc-7ae22829afb2b4ca531d1c00437d428f55d59341.tar.gz
glibc-7ae22829afb2b4ca531d1c00437d428f55d59341.tar.xz
glibc-7ae22829afb2b4ca531d1c00437d428f55d59341.zip
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.
Diffstat (limited to 'sysdeps/posix/getaddrinfo.c')
-rw-r--r--sysdeps/posix/getaddrinfo.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
index 5ddda889cf..1e017b2ed6 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)						      \
@@ -1015,7 +1015,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)
 	    {