]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
* sysdeps/posix/getaddrinfo.c (gaih_inet): Only use gethostbyname4_r
authorJeff Law <law@redhat.com>
Wed, 22 Aug 2012 17:41:40 +0000 (11:41 -0600)
committerJeff Law <law@redhat.com>
Wed, 22 Aug 2012 17:41:40 +0000 (11:41 -0600)
if the family is PF_UNSPEC.

ChangeLog
NEWS
sysdeps/posix/getaddrinfo.c

index 656b16893f8d686aef8df884bedfeb1c50251008..5c2aea1b0238dd1b2e4513f8179baa3907092c7e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-08-22  Jeff Law <law@redhat.com>
+
+       [BZ #14505]
+       * sysdeps/posix/getaddrinfo.c (gaih_inet): Only use gethostbyname4_r
+       if the family is PF_UNSPEC.
+
 2012-08-22  Mike Frysinger  <vapier@gentoo.org>
 
        * Makerules (lib-version): Rename from V.
diff --git a/NEWS b/NEWS
index 688dc434f6df27d5f87ae6328dbf5c713707b8db..075d1ba36db67dbb879f5fed0ea06e9ad27daa0d 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -61,7 +61,7 @@ Version 2.16
   14043, 14044, 14048, 14049, 14050, 14053, 14055, 14059, 14064, 14075,
   14080, 14083, 14103, 14104, 14109, 14112, 14117, 14122, 14123, 14134,
   14153, 14183, 14188, 14199, 14210, 14218, 14229, 14241, 14273, 14277,
-  14278
+  14278, 14505
 
 * Support for the x32 ABI on x86-64 added.  The x32 target is selected by
   configuring glibc with:
index 81e928ab9108604593ba4bea24209d38a4d5f6cd..05883bd55f0f0f0c83eec2269631725e5e70d3e3 100644 (file)
@@ -832,8 +832,13 @@ gaih_inet (const char *name, const struct gaih_service *service,
          while (!no_more)
            {
              no_data = 0;
-             nss_gethostbyname4_r fct4
-               = __nss_lookup_function (nip, "gethostbyname4_r");
+             nss_gethostbyname4_r fct4 = NULL;
+
+             /* gethostbyname4_r sends out parallel A and AAAA queries and
+                is thus only suitable for PF_UNSPEC.  */
+             if (req->ai_family == PF_UNSPEC)
+               fct4 = __nss_lookup_function (nip, "gethostbyname4_r");
+
              if (fct4 != NULL)
                {
                  int herrno;