apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r602176 - /apr/apr/trunk/network_io/unix/sockaddr.c
Date Fri, 07 Dec 2007 18:47:29 GMT
Author: wrowe
Date: Fri Dec  7 10:47:29 2007
New Revision: 602176

URL: http://svn.apache.org/viewvc?rev=602176&view=rev
Log:
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.



Modified:
    apr/apr/trunk/network_io/unix/sockaddr.c

Modified: apr/apr/trunk/network_io/unix/sockaddr.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/network_io/unix/sockaddr.c?rev=602176&r1=602175&r2=602176&view=diff
==============================================================================
--- apr/apr/trunk/network_io/unix/sockaddr.c (original)
+++ apr/apr/trunk/network_io/unix/sockaddr.c Fri Dec  7 10:47:29 2007
@@ -344,6 +344,11 @@
         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) {



Mime
View raw message