summaryrefslogtreecommitdiff
path: root/network_io
diff options
context:
space:
mode:
authorWilliam A. Rowe Jr <wrowe@apache.org>2007-12-07 18:47:29 +0000
committerWilliam A. Rowe Jr <wrowe@apache.org>2007-12-07 18:47:29 +0000
commit8c9f2eb71cf6e45a0165cfe15ccc230de5ec9027 (patch)
tree3cec82bf1956116c6694e82948c803126ee2ee51 /network_io
parentac3abd91bfb3d09d71e06b2b244c294a17ec6922 (diff)
downloadapr-8c9f2eb71cf6e45a0165cfe15ccc230de5ec9027.tar.gz
Where hostname is provided in ipv4 numeric form, as we've
foolishly cooerced all of our IPV4_MAPPED_IPV6 addresses, we'll need to accept this as a socket lookup call! Unfortunately, we failed to resolve, for example, 127.0.0.1 for INET6 addressing, where we would resolve ::ffff:127.0.0.1 But the AI_V4MAPPED flag will let us resolve this address after attempting to resolve the IPV6 notation. Feedback and careful review is desired before this is applied to branches 1.2 and 0.9. Thanks. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@602176 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'network_io')
-rw-r--r--network_io/unix/sockaddr.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c
index e70e3bcb1..f7863a7bd 100644
--- a/network_io/unix/sockaddr.c
+++ b/network_io/unix/sockaddr.c
@@ -344,6 +344,11 @@ static apr_status_t call_resolver(apr_sockaddr_t **sa,
servname = apr_itoa(p, port);
#endif /* OSF1 */
}
+#if APR_HAVE_IPV6 && defined(AI_V4MAPPED)
+ else if (family == APR_INET6) {
+ hints.ai_flags |= AI_V4MAPPED;
+ }
+#endif
error = getaddrinfo(hostname, servname, &hints, &ai_list);
#ifdef HAVE_GAI_ADDRCONFIG
if (error == EAI_BADFLAGS && family == APR_UNSPEC) {