]> git.kaiwu.me - nginx.git/commitdiff
Modules compatibility: removed unneeded IPV6_V6ONLY checks.
authorMaxim Dounin <mdounin@mdounin.ru>
Mon, 3 Oct 2016 12:58:25 +0000 (15:58 +0300)
committerMaxim Dounin <mdounin@mdounin.ru>
Mon, 3 Oct 2016 12:58:25 +0000 (15:58 +0300)
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.

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

index e484c81da94e616f9df0daf9021368b3a87412ed..d9ee6851eb5cf967926f35c7c0ce486921a50cd0 100644 (file)
@@ -66,7 +66,7 @@ struct ngx_listening_s {
     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)
index e2fbe9cfae5fd1614e9b2c40c53afe652fef21cc..4ddab5604ce5c00e19e5c0ed438bd3d6cde610d9 100644 (file)
 #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"
index 7a46b3ecb50d52036098fe27cf33dd0a5388e65f..ba559f23141c2ec34c14cf07c8102584bd9bcaae 100644 (file)
@@ -1756,7 +1756,7 @@ ngx_http_add_listening(ngx_conf_t *cf, ngx_http_conf_addr_t *addr)
     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
 
index e26c3f72252845335e41b12593ab53d1f9c26838..2daea10135c402b548ba94a631eb5851de60565c 100644 (file)
@@ -3939,7 +3939,7 @@ ngx_http_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
     lsopt.fastopen = -1;
 #endif
     lsopt.wildcard = u.wildcard;
-#if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
+#if (NGX_HAVE_INET6)
     lsopt.ipv6only = 1;
 #endif
 
index a8013b184bef6e6537580e715c639fb27ac8025b..fdd70041da0d7473eaf39ce0083de3259b935072 100644 (file)
@@ -69,7 +69,7 @@ typedef struct {
     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)
index e5a77b05b3ce0fda12a39f5769a1a0a6bdb9b5a5..9e560bb7c95df02564fc85bccfaeac1891a64595 100644 (file)
@@ -341,7 +341,7 @@ ngx_mail_optimize_servers(ngx_conf_t *cf, ngx_array_t *ports)
             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
 
index 1068bb3689600c931d76e567bcaca89bdde53b82..7c8422894b8524fecee5b0f27d35591392a41d94 100644 (file)
@@ -38,7 +38,7 @@ typedef struct {
 #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;
index 48eacfa28acf0f12fdae023398adfaa4d3ab8e50..b974d905c009db147ef5dea0941170cd57871f33 100644 (file)
@@ -353,7 +353,7 @@ ngx_mail_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
     ls->wildcard = u.wildcard;
     ls->ctx = cf->ctx;
 
-#if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
+#if (NGX_HAVE_INET6)
     ls->ipv6only = 1;
 #endif
 
index 7312c3e2e86775183b4fd8449b54f6225fffe40d..b982c1fee7796e00d6786597d7dc12863ac28083 100644 (file)
@@ -506,7 +506,7 @@ ngx_stream_optimize_servers(ngx_conf_t *cf, ngx_array_t *ports)
             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
 
index a2644a73afb03745936aca01446e485bb1d45b97..7cb8ae31de10cf9e99e6fd708dd0a03525a91b79 100644 (file)
@@ -52,7 +52,7 @@ typedef struct {
 #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)
index 23644f3d26f676eee79d181731f39d48140e5497..f7870eed501b9b511be333ca44a496ba507fe60b 100644 (file)
@@ -624,7 +624,7 @@ ngx_stream_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
     ls->wildcard = u.wildcard;
     ls->ctx = cf->ctx;
 
-#if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
+#if (NGX_HAVE_INET6)
     ls->ipv6only = 1;
 #endif