aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/posix/getaddrinfo.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2002-12-17 01:16:31 +0000
committerUlrich Drepper <drepper@redhat.com>2002-12-17 01:16:31 +0000
commit64ab2317a89b3965e7d7230bb99cfc99a61f895f (patch)
tree1e0b30898630a4a2964dc254471a0f1073f89b1a /sysdeps/posix/getaddrinfo.c
parentf83c7164365526788d69128a506d81777e4092b3 (diff)
downloadglibc-64ab2317a89b3965e7d7230bb99cfc99a61f895f.zip
glibc-64ab2317a89b3965e7d7230bb99cfc99a61f895f.tar.gz
glibc-64ab2317a89b3965e7d7230bb99cfc99a61f895f.tar.bz2
Update.
2002-12-16 Ulrich Drepper <drepper@redhat.com> * sysdeps/posix/getaddrinfo.c (gaih_inet): If __nss_lookup_function fails to return a function pointer don't use it.
Diffstat (limited to 'sysdeps/posix/getaddrinfo.c')
-rw-r--r--sysdeps/posix/getaddrinfo.c41
1 files changed, 22 insertions, 19 deletions
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
index 4af40f9..dd6e415 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
@@ -570,25 +570,28 @@ gaih_inet (const char *name, const struct gaih_service *service,
{
fct = __nss_lookup_function (nip, "gethostbyname2_r");
- gethosts2 (AF_INET6, struct in6_addr);
- no_inet6_data = no_data;
- inet6_status = status;
- gethosts2 (AF_INET, struct in_addr);
-
- /* If we found one address for AF_INET or AF_INET6,
- don't continue the search. */
- if (inet6_status == NSS_STATUS_SUCCESS ||
- status == NSS_STATUS_SUCCESS)
- break;
-
- /* We can have different states for AF_INET
- and AF_INET6. Try to find a usefull 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;
+ if (fct != NULL)
+ {
+ gethosts2 (AF_INET6, struct in6_addr);
+ no_inet6_data = no_data;
+ inet6_status = status;
+ gethosts2 (AF_INET, struct in_addr);
+
+ /* If we found one address for AF_INET or AF_INET6,
+ don't continue the search. */
+ if (inet6_status == NSS_STATUS_SUCCESS ||
+ status == NSS_STATUS_SUCCESS)
+ break;
+
+ /* We can have different states for AF_INET
+ and AF_INET6. Try to find a usefull 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;
+ }
if (nss_next_action (nip, status) == NSS_ACTION_RETURN)
break;