diff src/http/ngx_http_core_module.c @ 4771:bdcdbdf35b52

Core: ipv6only is now on by default. There is a general consensus that this change results in better consistency between different operating systems and differently tuned operating systems. Note: this changes the width and meaning of the ipv6only field of the ngx_listening_t structure. 3rd party modules that create their own listening sockets might need fixing.
author Ruslan Ermilov <ru@nginx.com>
date Mon, 30 Jul 2012 12:27:06 +0000
parents 1c5e2e4d5b35
children b07931054bf1
line wrap: on
line diff
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -3912,6 +3912,9 @@ ngx_http_core_listen(ngx_conf_t *cf, ngx
     lsopt.setfib = -1;
 #endif
     lsopt.wildcard = u.wildcard;
+#if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
+    lsopt.ipv6only = 1;
+#endif
 
     (void) ngx_sock_ntop(&lsopt.u.sockaddr, lsopt.addr,
                          NGX_SOCKADDR_STRLEN, 1);
@@ -4031,7 +4034,7 @@ ngx_http_core_listen(ngx_conf_t *cf, ngx
                     lsopt.ipv6only = 1;
 
                 } else if (ngx_strcmp(&value[n].data[10], "ff") == 0) {
-                    lsopt.ipv6only = 2;
+                    lsopt.ipv6only = 0;
 
                 } else {
                     ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,