You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by wr...@apache.org on 2007/12/10 23:41:54 UTC
svn commit: r603082 - /apr/apr/trunk/network_io/unix/sockaddr.c
Author: wrowe
Date: Mon Dec 10 14:41:53 2007
New Revision: 603082
URL: http://svn.apache.org/viewvc?rev=603082&view=rev
Log:
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?
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=603082&r1=603081&r2=603082&view=diff
==============================================================================
--- apr/apr/trunk/network_io/unix/sockaddr.c (original)
+++ apr/apr/trunk/network_io/unix/sockaddr.c Mon Dec 10 14:41:53 2007
@@ -345,7 +345,7 @@
#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 @@
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);