summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorJeff Trawick <trawick@apache.org>2002-11-14 15:17:11 +0100
committerJeff Trawick <trawick@apache.org>2002-11-14 15:17:11 +0100
commit8ca3d031ce0af26556af37ca339bc28b92a1ab3d (patch)
treebd1edff4c1f9176f00b1f9564aa05d9a8b1dcf59 /server
parentNew XML. (diff)
downloadapache2-8ca3d031ce0af26556af37ca339bc28b92a1ab3d.tar.xz
apache2-8ca3d031ce0af26556af37ca339bc28b92a1ab3d.zip
Add --[enable|disable]-v4-mapped configure option to control
whether or not Apache expects to handle IPv4 connections on IPv6 listening sockets. Either setting will work on systems with the IPV6_V6ONLY socket option. --enable-v4-mapped must be used on systems that always allow IPv4 connections on IPv6 listening sockets. Note: As the ssl config file is not automatically generated and it is expected to require editing anyway to work, the only change there was to suggest the required Listen statements in a comment. PR: PR 14037 (Bugzilla), PR 7492 (Gnats), various dups of these PRs git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97516 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server')
-rw-r--r--server/listen.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/server/listen.c b/server/listen.c
index e57bef075e..cbdefae9bd 100644
--- a/server/listen.c
+++ b/server/listen.c
@@ -88,6 +88,13 @@ static apr_status_t make_sock(apr_pool_t *p, ap_listen_rec *server)
{
apr_socket_t *s = server->sd;
int one = 1;
+#if APR_HAVE_IPV6
+#ifdef AP_ENABLE_V4_MAPPED
+ int v6only_setting = 0;
+#else
+ int v6only_setting = 1;
+#endif
+#endif
apr_status_t stat;
#ifndef WIN32
@@ -110,6 +117,18 @@ static apr_status_t make_sock(apr_pool_t *p, ap_listen_rec *server)
return stat;
}
+#if APR_HAVE_IPV6
+ stat = apr_socket_opt_set(s, APR_IPV6_V6ONLY, v6only_setting);
+ if (stat != APR_SUCCESS && stat != APR_ENOTIMPL) {
+ ap_log_perror(APLOG_MARK, APLOG_CRIT, stat, p,
+ "make_sock: for address %pI, apr_socket_opt_set: "
+ "(IPV6_V6ONLY)",
+ server->bind_addr);
+ apr_socket_close(s);
+ return stat;
+ }
+#endif
+
/*
* To send data over high bandwidth-delay connections at full
* speed we must force the TCP window to open wide enough to keep the