diff options
author | Maxim Dounin <mdounin@mdounin.ru> | 2016-10-03 15:58:25 +0300 |
---|---|---|
committer | Maxim Dounin <mdounin@mdounin.ru> | 2016-10-03 15:58:25 +0300 |
commit | 0a961a09171fc1de3f3a70aa6b15e29d3882f7f0 (patch) | |
tree | 2121db4e34c3ed4d7512fb9d60bda49fb3fc7a43 /src | |
parent | a7f80ec354dd470a1da09585f8a74dd73d3ce883 (diff) |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/core/ngx_connection.h | 2 | ||||
-rw-r--r-- | src/core/ngx_module.h | 4 | ||||
-rw-r--r-- | src/http/ngx_http.c | 2 | ||||
-rw-r--r-- | src/http/ngx_http_core_module.c | 2 | ||||
-rw-r--r-- | src/http/ngx_http_core_module.h | 2 | ||||
-rw-r--r-- | src/mail/ngx_mail.c | 2 | ||||
-rw-r--r-- | src/mail/ngx_mail.h | 2 | ||||
-rw-r--r-- | src/mail/ngx_mail_core_module.c | 2 | ||||
-rw-r--r-- | src/stream/ngx_stream.c | 2 | ||||
-rw-r--r-- | src/stream/ngx_stream.h | 2 | ||||
-rw-r--r-- | src/stream/ngx_stream_core_module.c | 2 |
11 files changed, 10 insertions, 14 deletions
diff --git a/src/core/ngx_connection.h b/src/core/ngx_connection.h index e484c81da..d9ee6851e 100644 --- a/src/core/ngx_connection.h +++ b/src/core/ngx_connection.h @@ -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) diff --git a/src/core/ngx_module.h b/src/core/ngx_module.h index e2fbe9cfa..4ddab5604 100644 --- a/src/core/ngx_module.h +++ b/src/core/ngx_module.h @@ -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" diff --git a/src/http/ngx_http.c b/src/http/ngx_http.c index 7a46b3ecb..ba559f231 100644 --- a/src/http/ngx_http.c +++ b/src/http/ngx_http.c @@ -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 diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c index e26c3f722..2daea1013 100644 --- a/src/http/ngx_http_core_module.c +++ b/src/http/ngx_http_core_module.c @@ -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 diff --git a/src/http/ngx_http_core_module.h b/src/http/ngx_http_core_module.h index a8013b184..fdd70041d 100644 --- a/src/http/ngx_http_core_module.h +++ b/src/http/ngx_http_core_module.h @@ -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) diff --git a/src/mail/ngx_mail.c b/src/mail/ngx_mail.c index e5a77b05b..9e560bb7c 100644 --- a/src/mail/ngx_mail.c +++ b/src/mail/ngx_mail.c @@ -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 diff --git a/src/mail/ngx_mail.h b/src/mail/ngx_mail.h index 1068bb368..7c8422894 100644 --- a/src/mail/ngx_mail.h +++ b/src/mail/ngx_mail.h @@ -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; diff --git a/src/mail/ngx_mail_core_module.c b/src/mail/ngx_mail_core_module.c index 48eacfa28..b974d905c 100644 --- a/src/mail/ngx_mail_core_module.c +++ b/src/mail/ngx_mail_core_module.c @@ -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 diff --git a/src/stream/ngx_stream.c b/src/stream/ngx_stream.c index 7312c3e2e..b982c1fee 100644 --- a/src/stream/ngx_stream.c +++ b/src/stream/ngx_stream.c @@ -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 diff --git a/src/stream/ngx_stream.h b/src/stream/ngx_stream.h index a2644a73a..7cb8ae31d 100644 --- a/src/stream/ngx_stream.h +++ b/src/stream/ngx_stream.h @@ -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) diff --git a/src/stream/ngx_stream_core_module.c b/src/stream/ngx_stream_core_module.c index 23644f3d2..f7870eed5 100644 --- a/src/stream/ngx_stream_core_module.c +++ b/src/stream/ngx_stream_core_module.c @@ -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 |