diff -r bd651c4e7623 src/core/ngx_connection.c
--- a/src/core/ngx_connection.c	Fri Aug 27 23:32:19 2010 +0200
+++ b/src/core/ngx_connection.c	Fri Aug 27 23:58:59 2010 +0200
@@ -264,14 +264,14 @@
 ngx_int_t
 ngx_open_listening_sockets(ngx_cycle_t *cycle)
 {
-    int               reuseaddr;
+    int               on;
     ngx_uint_t        i, tries, failed;
     ngx_err_t         err;
     ngx_log_t        *log;
     ngx_socket_t      s;
     ngx_listening_t  *ls;
 
-    reuseaddr = 1;
+    on = 1;
 #if (NGX_SUPPRESS_WARN)
     failed = 0;
 #endif
@@ -314,7 +314,7 @@
             }
 
             if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR,
-                           (const void *) &reuseaddr, sizeof(int))
+                           (const void *) &on, sizeof(int))
                 == -1)
             {
                 ngx_log_error(NGX_LOG_EMERG, log, ngx_socket_errno,
@@ -330,15 +330,11 @@
                 return NGX_ERROR;
             }
 
-#if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
+#if (NGX_HAVE_INET6)
 
-            if (ls[i].sockaddr->sa_family == AF_INET6 && ls[i].ipv6only) {
-                int  ipv6only;
-
-                ipv6only = (ls[i].ipv6only == 1);
-
+            if (ls[i].sockaddr->sa_family == AF_INET6) {
                 if (setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY,
-                               (const void *) &ipv6only, sizeof(int))
+                               (const void *) &on, sizeof(int))
                     == -1)
                 {
                     ngx_log_error(NGX_LOG_EMERG, log, ngx_socket_errno,
diff -r bd651c4e7623 src/core/ngx_connection.h
--- a/src/core/ngx_connection.h	Fri Aug 27 23:32:19 2010 +0200
+++ b/src/core/ngx_connection.h	Fri Aug 27 23:58:59 2010 +0200
@@ -57,10 +57,6 @@
     unsigned            shared:1;    /* shared between threads or processes */
     unsigned            addr_ntop:1;
 
-#if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
-    unsigned            ipv6only:2;
-#endif
-
 #if (NGX_HAVE_DEFERRED_ACCEPT)
     unsigned            deferred_accept:1;
     unsigned            delete_deferred:1;
diff -r bd651c4e7623 src/http/ngx_http.c
--- a/src/http/ngx_http.c	Fri Aug 27 23:32:19 2010 +0200
+++ b/src/http/ngx_http.c	Fri Aug 27 23:58:59 2010 +0200
@@ -1758,10 +1758,6 @@
     ls->deferred_accept = addr->opt.deferred_accept;
 #endif
 
-#if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
-    ls->ipv6only = addr->opt.ipv6only;
-#endif
-
 #if (NGX_HAVE_SETFIB)
     ls->setfib = addr->opt.setfib;
 #endif
diff -r bd651c4e7623 src/http/ngx_http_core_module.c
--- a/src/http/ngx_http_core_module.c	Fri Aug 27 23:32:19 2010 +0200
+++ b/src/http/ngx_http_core_module.c	Fri Aug 27 23:58:59 2010 +0200
@@ -3528,45 +3528,6 @@
             continue;
         }
 
-        if (ngx_strncmp(value[n].data, "ipv6only=o", 10) == 0) {
-#if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
-            struct sockaddr  *sa;
-
-            sa = &lsopt.u.sockaddr;
-
-            if (sa->sa_family == AF_INET6) {
-
-                if (ngx_strcmp(&value[n].data[10], "n") == 0) {
-                    lsopt.ipv6only = 1;
-
-                } else if (ngx_strcmp(&value[n].data[10], "ff") == 0) {
-                    lsopt.ipv6only = 2;
-
-                } else {
-                    ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
-                                       "invalid ipv6only flags \"%s\"",
-                                       &value[n].data[9]);
-                    return NGX_CONF_ERROR;
-                }
-
-                lsopt.set = 1;
-                lsopt.bind = 1;
-
-            } else {
-                ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
-                                   "ipv6only is not supported "
-                                   "on addr \"%s\", ignored", lsopt.addr);
-            }
-
-            continue;
-#else
-            ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
-                               "bind ipv6only is not supported "
-                               "on this platform");
-            return NGX_CONF_ERROR;
-#endif
-        }
-
         if (ngx_strcmp(value[n].data, "ssl") == 0) {
 #if (NGX_HTTP_SSL)
             lsopt.set = 1;
diff -r bd651c4e7623 src/http/ngx_http_core_module.h
--- a/src/http/ngx_http_core_module.h	Fri Aug 27 23:32:19 2010 +0200
+++ b/src/http/ngx_http_core_module.h	Fri Aug 27 23:58:59 2010 +0200
@@ -64,9 +64,6 @@
 #if (NGX_HTTP_SSL)
     unsigned                   ssl:1;
 #endif
-#if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
-    unsigned                   ipv6only:2;
-#endif
 
     int                        backlog;
     int                        rcvbuf;
diff -r bd651c4e7623 src/mail/ngx_mail.c
--- a/src/mail/ngx_mail.c	Fri Aug 27 23:32:19 2010 +0200
+++ b/src/mail/ngx_mail.c	Fri Aug 27 23:58:59 2010 +0200
@@ -311,9 +311,6 @@
 #if (NGX_MAIL_SSL)
     addr->ssl = listen->ssl;
 #endif
-#if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
-    addr->ipv6only = listen->ipv6only;
-#endif
 
     return NGX_OK;
 }
@@ -373,10 +370,6 @@
             ls->log.data = &ls->addr_text;
             ls->log.handler = ngx_accept_log_error;
 
-#if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
-            ls->ipv6only = addr[i].ipv6only;
-#endif
-
             mport = ngx_palloc(cf->pool, sizeof(ngx_mail_port_t));
             if (mport == NULL) {
                 return NGX_CONF_ERROR;
diff -r bd651c4e7623 src/mail/ngx_mail.h
--- a/src/mail/ngx_mail.h	Fri Aug 27 23:32:19 2010 +0200
+++ b/src/mail/ngx_mail.h	Fri Aug 27 23:58:59 2010 +0200
@@ -37,9 +37,6 @@
 #if (NGX_MAIL_SSL)
     unsigned                ssl:1;
 #endif
-#if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
-    unsigned                ipv6only:2;
-#endif
 } ngx_mail_listen_t;
 
 
@@ -92,9 +89,6 @@
 #if (NGX_MAIL_SSL)
     unsigned                ssl:1;
 #endif
-#if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
-    unsigned                ipv6only:2;
-#endif
 } ngx_mail_conf_addr_t;
 
 
diff -r bd651c4e7623 src/mail/ngx_mail_core_module.c
--- a/src/mail/ngx_mail_core_module.c	Fri Aug 27 23:32:19 2010 +0200
+++ b/src/mail/ngx_mail_core_module.c	Fri Aug 27 23:58:59 2010 +0200
@@ -393,47 +393,6 @@
             continue;
         }
 
-        if (ngx_strncmp(value[i].data, "ipv6only=o", 10) == 0) {
-#if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
-            struct sockaddr  *sa;
-            u_char            buf[NGX_SOCKADDR_STRLEN];
-
-            sa = (struct sockaddr *) ls->sockaddr;
-
-            if (sa->sa_family == AF_INET6) {
-
-                if (ngx_strcmp(&value[i].data[10], "n") == 0) {
-                    ls->ipv6only = 1;
-
-                } else if (ngx_strcmp(&value[i].data[10], "ff") == 0) {
-                    ls->ipv6only = 2;
-
-                } else {
-                    ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
-                                       "invalid ipv6only flags \"%s\"",
-                                       &value[i].data[9]);
-                    return NGX_CONF_ERROR;
-                }
-
-                ls->bind = 1;
-
-            } else {
-                len = ngx_sock_ntop(sa, buf, NGX_SOCKADDR_STRLEN, 1);
-
-                ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
-                                   "ipv6only is not supported "
-                                   "on addr \"%*s\", ignored", len, buf);
-            }
-
-            continue;
-#else
-            ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
-                               "bind ipv6only is not supported "
-                               "on this platform");
-            return NGX_CONF_ERROR;
-#endif
-        }
-
         if (ngx_strcmp(value[i].data, "ssl") == 0) {
 #if (NGX_MAIL_SSL)
             ls->ssl = 1;
