nameserv: don't return scoped IPv6 addresses

Ignore IPv6 addresses returned by getaddrinfo() that have a non-zero
scope ID to avoid silently ignoring the ID if it was specified with the
% sign in the provided string.

This can be removed when the scope ID is returned from the function and
the callers handle it.
This commit is contained in:
Miroslav Lichvar
2020-06-29 16:56:09 +02:00
parent 3fc72c0cfa
commit 59cf4e0b96
2 changed files with 4 additions and 0 deletions

1
configure vendored
View File

@@ -657,6 +657,7 @@ if [ $feat_ipv6 = "1" ] && \
struct sockaddr_in6 n;
char p[100];
n.sin6_addr = in6addr_any;
n.sin6_scope_id = 0;
return !inet_ntop(AF_INET6, &n.sin6_addr.s6_addr, p, sizeof(p));'
then
add_def FEAT_IPV6