changeset 6719:cebf5fed00bf

Modules compatibility: removed unneeded IPV6_V6ONLY checks. The IPV6_V6ONLY macro is now checked only while parsing appropriate flag and when using the macro. The ipv6only field in listen structures is always initialized to 1, even if not supported on a given platform. This is expected to prevent a module compiled without IPV6_V6ONLY from accidentally creating dual sockets if loaded into main binary with proper IPV6_V6ONLY support.
author Maxim Dounin <mdounin@mdounin.ru>
date Mon, 03 Oct 2016 15:58:25 +0300
parents bdf64ae3376b
children 9170240f1241
files src/core/ngx_connection.h src/core/ngx_module.h src/http/ngx_http.c src/http/ngx_http_core_module.c src/http/ngx_http_core_module.h src/mail/ngx_mail.c src/mail/ngx_mail.h src/mail/ngx_mail_core_module.c src/stream/ngx_stream.c src/stream/ngx_stream.h src/stream/ngx_stream_core_module.c
diffstat 11 files changed, 10 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/src/core/ngx_connection.h	Mon Oct 03 15:58:22 2016 +0300
+++ b/src/core/ngx_connection.h	Mon Oct 03 15:58:25 2016 +0300
@@ -66,7 +66,7 @@
     unsigned            addr_ntop:1;
     unsigned            wildcard:1;
 
-#if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
+#if (NGX_HAVE_INET6)
     unsigned            ipv6only:1;
 #endif
 #if (NGX_HAVE_REUSEPORT)
--- a/src/core/ngx_module.h	Mon Oct 03 15:58:22 2016 +0300
+++ b/src/core/ngx_module.h	Mon Oct 03 15:58:25 2016 +0300
@@ -71,11 +71,7 @@
 #define NGX_MODULE_SIGNATURE_8   "0"
 #endif
 
-#if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
 #define NGX_MODULE_SIGNATURE_9   "1"
-#else
-#define NGX_MODULE_SIGNATURE_9   "0"
-#endif
 
 #if (NGX_HAVE_REUSEPORT)
 #define NGX_MODULE_SIGNATURE_10  "1"
--- a/src/http/ngx_http.c	Mon Oct 03 15:58:22 2016 +0300
+++ b/src/http/ngx_http.c	Mon Oct 03 15:58:25 2016 +0300
@@ -1756,7 +1756,7 @@
     ls->deferred_accept = addr->opt.deferred_accept;
 #endif
 
-#if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
+#if (NGX_HAVE_INET6)
     ls->ipv6only = addr->opt.ipv6only;
 #endif
 
--- a/src/http/ngx_http_core_module.c	Mon Oct 03 15:58:22 2016 +0300
+++ b/src/http/ngx_http_core_module.c	Mon Oct 03 15:58:25 2016 +0300
@@ -3939,7 +3939,7 @@
     lsopt.fastopen = -1;
 #endif
     lsopt.wildcard = u.wildcard;
-#if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
+#if (NGX_HAVE_INET6)
     lsopt.ipv6only = 1;
 #endif
 
--- a/src/http/ngx_http_core_module.h	Mon Oct 03 15:58:22 2016 +0300
+++ b/src/http/ngx_http_core_module.h	Mon Oct 03 15:58:25 2016 +0300
@@ -69,7 +69,7 @@
     unsigned                   ssl:1;
 #endif
     unsigned                   http2:1;
-#if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
+#if (NGX_HAVE_INET6)
     unsigned                   ipv6only:1;
 #endif
 #if (NGX_HAVE_REUSEPORT)
--- a/src/mail/ngx_mail.c	Mon Oct 03 15:58:22 2016 +0300
+++ b/src/mail/ngx_mail.c	Mon Oct 03 15:58:25 2016 +0300
@@ -341,7 +341,7 @@
             ls->keepcnt = addr[i].opt.tcp_keepcnt;
 #endif
 
-#if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
+#if (NGX_HAVE_INET6)
             ls->ipv6only = addr[i].opt.ipv6only;
 #endif
 
--- a/src/mail/ngx_mail.h	Mon Oct 03 15:58:22 2016 +0300
+++ b/src/mail/ngx_mail.h	Mon Oct 03 15:58:25 2016 +0300
@@ -38,7 +38,7 @@
 #if (NGX_MAIL_SSL)
     unsigned                ssl:1;
 #endif
-#if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
+#if (NGX_HAVE_INET6)
     unsigned                ipv6only:1;
 #endif
     unsigned                so_keepalive:2;
--- a/src/mail/ngx_mail_core_module.c	Mon Oct 03 15:58:22 2016 +0300
+++ b/src/mail/ngx_mail_core_module.c	Mon Oct 03 15:58:25 2016 +0300
@@ -353,7 +353,7 @@
     ls->wildcard = u.wildcard;
     ls->ctx = cf->ctx;
 
-#if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
+#if (NGX_HAVE_INET6)
     ls->ipv6only = 1;
 #endif
 
--- a/src/stream/ngx_stream.c	Mon Oct 03 15:58:22 2016 +0300
+++ b/src/stream/ngx_stream.c	Mon Oct 03 15:58:25 2016 +0300
@@ -506,7 +506,7 @@
             ls->keepcnt = addr[i].opt.tcp_keepcnt;
 #endif
 
-#if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
+#if (NGX_HAVE_INET6)
             ls->ipv6only = addr[i].opt.ipv6only;
 #endif
 
--- a/src/stream/ngx_stream.h	Mon Oct 03 15:58:22 2016 +0300
+++ b/src/stream/ngx_stream.h	Mon Oct 03 15:58:25 2016 +0300
@@ -52,7 +52,7 @@
 #if (NGX_STREAM_SSL)
     unsigned                       ssl:1;
 #endif
-#if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
+#if (NGX_HAVE_INET6)
     unsigned                       ipv6only:1;
 #endif
 #if (NGX_HAVE_REUSEPORT)
--- a/src/stream/ngx_stream_core_module.c	Mon Oct 03 15:58:22 2016 +0300
+++ b/src/stream/ngx_stream_core_module.c	Mon Oct 03 15:58:25 2016 +0300
@@ -624,7 +624,7 @@
     ls->wildcard = u.wildcard;
     ls->ctx = cf->ctx;
 
-#if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
+#if (NGX_HAVE_INET6)
     ls->ipv6only = 1;
 #endif