about summary refs log tree commit diff
path: root/sysdeps/posix/getaddrinfo.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2010-03-26 05:40:27 -0700
committerUlrich Drepper <drepper@redhat.com>2010-03-26 05:40:27 -0700
commit7c9302908ee9ce1c21d930923a879c2cbef5242f (patch)
tree6512a54a64f265695705eaf79329fa2e0ad3f770 /sysdeps/posix/getaddrinfo.c
parentc3dfadb87e16f0fab6f4d5242bcecf06c02976c7 (diff)
downloadglibc-7c9302908ee9ce1c21d930923a879c2cbef5242f.tar.gz
glibc-7c9302908ee9ce1c21d930923a879c2cbef5242f.tar.xz
glibc-7c9302908ee9ce1c21d930923a879c2cbef5242f.zip
Don't abort immediately on successful lookup in getaddrinfo.
When not using gethostbyname4 methods we immediately aborted the loop
over the nss modules on the first successful lookup.  While this is
almost always what is wanted the nsswitch.conf file allows to select
something different.
Diffstat (limited to 'sysdeps/posix/getaddrinfo.c')
-rw-r--r--sysdeps/posix/getaddrinfo.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
index 8b7e38fdea..597189f744 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
@@ -817,17 +817,17 @@ gaih_inet (const char *name, const struct gaih_service *service,
 				    canon = name;
 				}
 			    }
-
-			  break;
 			}
-
-		      /* We can have different states for AF_INET and
-			 AF_INET6.  Try to find a useful one for both.  */
-		      if (inet6_status == NSS_STATUS_TRYAGAIN)
-			status = NSS_STATUS_TRYAGAIN;
-		      else if (status == NSS_STATUS_UNAVAIL
-			       && inet6_status != NSS_STATUS_UNAVAIL)
-			status = inet6_status;
+		      else
+			{
+			  /* We can have different states for AF_INET and
+			     AF_INET6.  Try to find a useful one for both.  */
+			  if (inet6_status == NSS_STATUS_TRYAGAIN)
+			    status = NSS_STATUS_TRYAGAIN;
+			  else if (status == NSS_STATUS_UNAVAIL
+				   && inet6_status != NSS_STATUS_UNAVAIL)
+			    status = inet6_status;
+			}
 		    }
 		  else
 		    status = NSS_STATUS_UNAVAIL;