aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/posix
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-09-18 23:57:46 +0000
committerUlrich Drepper <drepper@redhat.com>2004-09-18 23:57:46 +0000
commitd72433621f75bce7281adb7060459f6918287926 (patch)
tree4f261bb2474ac0af7fdc45b167ab8a4a3be165c7 /sysdeps/posix
parent1ab1fa6fb741caf552f2f1d79467d2455655d02b (diff)
downloadglibc-d72433621f75bce7281adb7060459f6918287926.tar
glibc-d72433621f75bce7281adb7060459f6918287926.tar.gz
glibc-d72433621f75bce7281adb7060459f6918287926.tar.bz2
glibc-d72433621f75bce7281adb7060459f6918287926.zip
Update.
* sysdeps/posix/getaddrinfo.c (gaih_inet): Do not use gethostbyname3_r if we are not looking for the canonical name.
Diffstat (limited to 'sysdeps/posix')
-rw-r--r--sysdeps/posix/getaddrinfo.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
index f9d0bf42fe..b3f9f4f9b0 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
@@ -775,8 +775,13 @@ gaih_inet (const char *name, const struct gaih_service *service,
while (!no_more)
{
- nss_gethostbyname3_r fct
- = __nss_lookup_function (nip, "gethostbyname3_r");
+ nss_gethostbyname3_r fct = NULL;
+ if (req->ai_flags & AI_CANONNAME)
+ /* No need to use this function if we do not look for
+ the canonical name. The function does not exist in
+ all NSS modules and therefore the lookup would
+ often fail. */
+ fct = __nss_lookup_function (nip, "gethostbyname3_r");
if (fct == NULL)
/* We are cheating here. The gethostbyname2_r function does
not have the same interface as gethostbyname3_r but the