diff options
author | William A. Rowe Jr <wrowe@apache.org> | 2007-12-10 22:41:53 +0000 |
---|---|---|
committer | William A. Rowe Jr <wrowe@apache.org> | 2007-12-10 22:41:53 +0000 |
commit | ac6fb48340107884ab77f152cc0ecb01095fe0f4 (patch) | |
tree | b528f36471c8a82225af754ac5fd94c64d03b1bb /network_io | |
parent | f1166f90d40f35d4b7851f38d2cc0eba42ce34ce (diff) | |
download | apr-ac6fb48340107884ab77f152cc0ecb01095fe0f4.tar.gz |
Propose a patch to satisfy Joe's concerns about returning IPv4 mapped addresses
when they are not desired.
Limit the scope of resolving IPv4 addresses with IPv6 mapping to the sole case
that the user requests APR_INET6 family, but permits APR_IPV4_ADDR_OK.
Does this addition to r602176 satisfy everyone's concerns?
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@603082 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'network_io')
-rw-r--r-- | network_io/unix/sockaddr.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index f7863a7bd..0a00afac0 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -345,7 +345,7 @@ static apr_status_t call_resolver(apr_sockaddr_t **sa, #endif /* OSF1 */ } #if APR_HAVE_IPV6 && defined(AI_V4MAPPED) - else if (family == APR_INET6) { + if (flags & APR_IPV4_ADDR_OK && family == APR_INET6) { hints.ai_flags |= AI_V4MAPPED; } #endif @@ -419,6 +419,11 @@ static apr_status_t find_addresses(apr_sockaddr_t **sa, apr_port_t port, apr_int32_t flags, apr_pool_t *p) { +#if APR_HAVE_IPV6 + if (flags & APR_IPV4_ADDR_OK && family == APR_INET6) { + apr_status_t error = call_resolver(sa, hostname, family, port, flags, p); + else +#endif if (flags & APR_IPV4_ADDR_OK) { apr_status_t error = call_resolver(sa, hostname, AF_INET, port, flags, p); |