From: Jeff Trawick Date: Fri, 22 Nov 2002 12:23:10 +0000 (+0000) Subject: Fix critical bug in new --enable-v4-mapped configure option X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2ee253343fb659721dfcc83fab436a147390c4d6;p=apache Fix critical bug in new --enable-v4-mapped configure option implementation which broke IPv4 listening sockets on systems with IPV6_V6ONLY socket option. That option should only be done on IPv6 listening sockets. Submitted by: hiroyuki hanai ] Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97595 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 0e6c4e1e0d..26430a327b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with Apache 2.0.44 + *) Fix critical bug in new --enable-v4-mapped configure option + implementation which broke IPv4 listening sockets on some + systems. [hiroyuki hanai ] + *) mod_autoindex: AddDescription directives for directories now work as in Apache 1.3, where no trailing '/' is specified on the directory name. Previously, the trailing diff --git a/server/listen.c b/server/listen.c index cbdefae9bd..148c0c7e73 100644 --- a/server/listen.c +++ b/server/listen.c @@ -118,14 +118,16 @@ static apr_status_t make_sock(apr_pool_t *p, ap_listen_rec *server) } #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; + if (server->bind_addr->family == APR_INET6) { + 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