]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Don't abort immediately on successful lookup in getaddrinfo.
authorUlrich Drepper <drepper@redhat.com>
Fri, 26 Mar 2010 12:40:27 +0000 (05:40 -0700)
committerUlrich Drepper <drepper@redhat.com>
Fri, 26 Mar 2010 12:40:27 +0000 (05:40 -0700)
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.

ChangeLog
sysdeps/posix/getaddrinfo.c

index 2ba417bb2ed5fa580dcc8892cd55580d8e4bc078..8117882671ed2ae6316ab0d3bec38c384b39686d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-03-26  Ulrich Drepper  <drepper@redhat.com>
+
+       * sysdeps/posix/getaddrinfo.c (gaih_inet): Don't assume success always
+       means aborting the loop over the NSS methods.
+
 2010-03-25  Andreas Schwab  <schwab@redhat.com>
 
        * sysdeps/posix/getaddrinfo.c (gaih_inet): Reset no_data before
index 8b7e38fdea11db4186a771fecda4d8efdc83f000..597189f744470ac85de89394ad6dd8a3b1824da2 100644 (file)
@@ -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;