]> granicus.if.org Git - apache/commitdiff
Fix critical bug in new --enable-v4-mapped configure option
authorJeff Trawick <trawick@apache.org>
Fri, 22 Nov 2002 12:23:10 +0000 (12:23 +0000)
committerJeff Trawick <trawick@apache.org>
Fri, 22 Nov 2002 12:23:10 +0000 (12:23 +0000)
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 <hanai@imgsrc.co.jp>]
Reviewed by: Jeff Trawick

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97595 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
server/listen.c

diff --git a/CHANGES b/CHANGES
index 0e6c4e1e0de29d47a87a32c514434c4578dc22c3..26430a327b04c0aacd6e450fa572fb29fcc40b24 100644 (file)
--- 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 <hanai@imgsrc.co.jp>]
+
   *) 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
index cbdefae9bd3b3288061b7452ccfd97a75264b4f3..148c0c7e73d9b1d3c85095f8e9fbce72e17239fe 100644 (file)
@@ -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