From: Andreas Schwab Date: Thu, 30 Jun 2011 10:33:32 +0000 (-0400) Subject: Make sure RES_USE_INET6 is always restored X-Git-Tag: glibc-2.14.1~35 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=01d737a4700a7f8971ba1adc70fcbff8f028f981;p=thirdparty%2Fglibc.git Make sure RES_USE_INET6 is always restored (cherry picked from commit 89f654c57b3b9a6aee480e25e37f88f06c898901) --- diff --git a/ChangeLog b/ChangeLog index 31d2047edf0..534ac2c0941 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-06-30 Andreas Schwab + + * sysdeps/posix/getaddrinfo.c (gaih_inet): Make sure RES_USE_INET6 + is always restored. + 2011-06-28 Ulrich Drepper [BZ #12935] diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c index 6b7423cda14..27ce75edc19 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; }