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.
This commit is contained in:
Ulrich Drepper 2010-03-26 05:40:27 -07:00
parent c3dfadb87e
commit 7c9302908e
2 changed files with 15 additions and 10 deletions

View File

@ -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

View 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;