1 diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
\r
2 index adb3c4f..d12835c 100644
\r
3 --- a/sysdeps/posix/getaddrinfo.c
\r
4 +++ b/sysdeps/posix/getaddrinfo.c
\r
5 @@ -263,7 +263,7 @@ extern service_user *__nss_hosts_database attribute_hidden;
\r
7 gaih_inet (const char *name, const struct gaih_service *service,
\r
8 const struct addrinfo *req, struct addrinfo **pai,
\r
9 - unsigned int *naddrs)
\r
10 + unsigned int *naddrs, bool usable_ipv6)
\r
12 const struct gaih_typeproto *tp = gaih_inet_typeproto;
\r
13 struct gaih_servtuple *st = (struct gaih_servtuple *) &nullserv;
\r
14 @@ -706,7 +706,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
\r
17 if (req->ai_family == AF_INET6
\r
18 - || req->ai_family == AF_UNSPEC)
\r
19 + || (req->ai_family == AF_UNSPEC && usable_ipv6))
\r
21 gethosts (AF_INET6, struct in6_addr);
\r
22 no_inet6_data = no_data;
\r
23 @@ -1903,7 +1903,7 @@ getaddrinfo (const char *name, const char *service,
\r
24 if (hints->ai_family == AF_UNSPEC || hints->ai_family == AF_INET
\r
25 || hints->ai_family == AF_INET6)
\r
27 - last_i = gaih_inet (name, pservice, hints, end, &naddrs);
\r
28 + last_i = gaih_inet (name, pservice, hints, end, &naddrs, seen_ipv6);
\r
32 diff --git a/sysdeps/unix/sysv/linux/check_pf.c b/sysdeps/unix/sysv/linux/check_pf.c
\r
33 index 46161a8..5287ed0 100644
\r
34 --- a/sysdeps/unix/sysv/linux/check_pf.c
\r
35 +++ b/sysdeps/unix/sysv/linux/check_pf.c
\r
36 @@ -146,7 +146,10 @@ make_request (int fd, pid_t pid, bool *seen_ipv4, bool *seen_ipv6,
\r
40 - *seen_ipv6 = true;
\r
41 + if (ifam->ifa_scope < RT_SCOPE_LINK)
\r
43 + *seen_ipv6 = true;
\r
46 if (ifam->ifa_flags & (IFA_F_DEPRECATED
\r