1 diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
2 index 81e928a..05883bd 100644
3 --- a/sysdeps/posix/getaddrinfo.c
4 +++ b/sysdeps/posix/getaddrinfo.c
5 @@ -832,8 +832,13 @@ gaih_inet (const char *name, const struct gaih_service *service,
9 - nss_gethostbyname4_r fct4
10 - = __nss_lookup_function (nip, "gethostbyname4_r");
11 + nss_gethostbyname4_r fct4 = NULL;
13 + /* gethostbyname4_r sends out parallel A and AAAA queries and
14 + is thus only suitable for PF_UNSPEC. */
15 + if (req->ai_family == PF_UNSPEC)
16 + fct4 = __nss_lookup_function (nip, "gethostbyname4_r");