ce426f
commit cf26a0cb6a0bbaca46a01ddad6662e5e5159a32a
ce426f
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
ce426f
Date:   Thu May 15 12:33:11 2014 +0530
ce426f
ce426f
    Return EAI_AGAIN for AF_UNSPEC when herrno is TRY_AGAIN (BZ #16849)
ce426f
    
ce426f
    getaddrinfo correctly returns EAI_AGAIN for AF_INET and AF_INET6
ce426f
    queries.  For AF_UNSPEC however, an older change
ce426f
    (a682a1bf553b1efe4dbb03207fece5b719cec482) broke the check and due to
ce426f
    that the returned error was EAI_NONAME.
ce426f
    
ce426f
    This patch fixes the check so that a non-authoritative not-found is
ce426f
    returned as EAI_AGAIN to the user instead of EAI_NONAME.
ce426f
ce426f
diff --git glibc-2.17-c758a686/sysdeps/posix/getaddrinfo.c glibc-2.17-c758a686/sysdeps/posix/getaddrinfo.c
ce426f
index 6258330..8f392b9 100644
ce426f
--- glibc-2.17-c758a686/sysdeps/posix/getaddrinfo.c
ce426f
+++ glibc-2.17-c758a686/sysdeps/posix/getaddrinfo.c
ce426f
@@ -867,8 +867,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
ce426f
 		      if (status != NSS_STATUS_TRYAGAIN
ce426f
 			  || rc != ERANGE || herrno != NETDB_INTERNAL)
ce426f
 			{
ce426f
-			  if (status == NSS_STATUS_TRYAGAIN
ce426f
-			      && herrno == TRY_AGAIN)
ce426f
+			  if (herrno == TRY_AGAIN)
ce426f
 			    no_data = EAI_AGAIN;
ce426f
 			  else
ce426f
 			    no_data = herrno == NO_DATA;