[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#52195: getaddrinfo() with PF_UNSPEC hints returns EAI_NODATA



  Hello.

  It seems that this bug was fixed at CVS version of glibc-2.1.2.

ChangeLog says
>1999-12-08  Ulrich Drepper  <drepper@cygnus.com>
>
>        * sysdeps/posix/getaddrinfo.c (gaih_inet): Don't fail if host has
>        only IPv6 address.  Reported by Artur Frysiak <wiget@pld.org.pl>.

So, I wish that following patch apply to next release.

--- sysdeps/posix/getaddrinfo.c    Wed Dec 22 16:15:54 1999
+++ sysdeps/posix/getaddrinfo.c    Thu Dec  9 04:01:20 1999
@@ -368,14 +368,16 @@
 	  struct hostent *h;
 	  struct gaih_addrtuple **pat = &at;
 	  int no_data = 0;
+	  int no_inet6_data;
 
 	  if (req->ai_family == AF_UNSPEC || req->ai_family == AF_INET6)
 	    gethosts (AF_INET6, struct in6_addr);
+	  no_inet6_data = no_data;
 
 	  if (req->ai_family == AF_UNSPEC || req->ai_family == AF_INET)
 	    gethosts (AF_INET, struct in_addr);
 
-	  if (no_data != 0)
+	  if (no_data != 0 && no_inet6_data != 0)
 	    /* We made requests but they turned out no data.  The name
 	       is known, though.  */
 	    return (GAIH_OKIFUNSPEC | -EAI_NODATA);

Regards.
-----------------------------------------
Dream Train Internet inc.
KUNITAKE Koichi<Technical Operation Dep.>
E-mail : kunitake@dti.ad.jp
-----------------------------------------



Reply to: