summaryrefslogtreecommitdiff
path: root/network_io
diff options
context:
space:
mode:
authorjerenkrantz <jerenkrantz@13f79535-47bb-0310-9956-ffa450edef68>2003-08-14 17:36:17 +0000
committerjerenkrantz <jerenkrantz@13f79535-47bb-0310-9956-ffa450edef68>2003-08-14 17:36:17 +0000
commitc476a4536353f28b0b1b57c72c1ecba0fd7922f3 (patch)
tree23211a7c7be6e33d2e4cfe06d218faabc091ff0e /network_io
parent9295cab9149b9d565697f6b78c3694a84aae6616 (diff)
downloadlibapr-c476a4536353f28b0b1b57c72c1ecba0fd7922f3.tar.gz
If we don't have IPv6 enabled within APR (even if the OS supports it), we
need to fail over to APR_INET rather than passing APR_UNSPEC. (Justin tweaked the patch so this code would always execute and add a description why we need this because it's not exactly obvious.) Submitted by: Colm MacCarthaigh <colm@stdlib.net> Reviewed by: Justin Erenkrantz git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64589 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'network_io')
-rw-r--r--network_io/unix/sockaddr.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c
index e721ef5e3..8ce8a8fe7 100644
--- a/network_io/unix/sockaddr.c
+++ b/network_io/unix/sockaddr.c
@@ -601,7 +601,17 @@ APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa,
}
#endif
}
-
+#if !APR_HAVE_IPV6
+ /* What may happen is that APR is not IPv6-enabled, but we're still
+ * going to call getaddrinfo(), so we have to tell the OS we only
+ * want IPv4 addresses back since we won't know what to do with
+ * IPv6 addresses.
+ */
+ if (family == APR_UNSPEC) {
+ family = APR_INET;
+ }
+#endif
+
return find_addresses(sa, hostname, family, port, flags, p);
}