diff options
author | Jeff Law <law@redhat.com> | 2012-08-22 11:41:40 -0600 |
---|---|---|
committer | Jeff Law <law@redhat.com> | 2012-08-22 11:41:40 -0600 |
commit | 8479f23aa1d5e5477a37f46823856bdafaedfa46 (patch) | |
tree | e4512a6e8ce06db0e40b6ff0caea8af51aa54e0e /sysdeps/posix | |
parent | 48da0b21630bb237b40086726f6ecd5bb2e2d988 (diff) | |
download | glibc-8479f23aa1d5e5477a37f46823856bdafaedfa46.tar.gz |
* sysdeps/posix/getaddrinfo.c (gaih_inet): Only use gethostbyname4_r
if the family is PF_UNSPEC.
Diffstat (limited to 'sysdeps/posix')
-rw-r--r-- | sysdeps/posix/getaddrinfo.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c index 81e928ab91..05883bd55f 100644 --- a/sysdeps/posix/getaddrinfo.c +++ b/sysdeps/posix/getaddrinfo.c @@ -832,8 +832,13 @@ gaih_inet (const char *name, const struct gaih_service *service, while (!no_more) { no_data = 0; - nss_gethostbyname4_r fct4 - = __nss_lookup_function (nip, "gethostbyname4_r"); + nss_gethostbyname4_r fct4 = NULL; + + /* gethostbyname4_r sends out parallel A and AAAA queries and + is thus only suitable for PF_UNSPEC. */ + if (req->ai_family == PF_UNSPEC) + fct4 = __nss_lookup_function (nip, "gethostbyname4_r"); + if (fct4 != NULL) { int herrno; |