mirror of
https://github.com/nginx/nginx.git
synced 2026-06-26 20:01:45 +00:00
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.
This commit is contained in:
parent
9c8f3d86b4
commit
deaf22d220
6 changed files with 15 additions and 8 deletions
|
|
@ -336,10 +336,10 @@ ngx_open_listening_sockets(ngx_cycle_t *cycle)
|
|||
|
||||
#if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
|
||||
|
||||
if (ls[i].sockaddr->sa_family == AF_INET6 && ls[i].ipv6only) {
|
||||
if (ls[i].sockaddr->sa_family == AF_INET6) {
|
||||
int ipv6only;
|
||||
|
||||
ipv6only = (ls[i].ipv6only == 1);
|
||||
ipv6only = ls[i].ipv6only;
|
||||
|
||||
if (setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY,
|
||||
(const void *) &ipv6only, sizeof(int))
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ struct ngx_listening_s {
|
|||
unsigned addr_ntop:1;
|
||||
|
||||
#if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
|
||||
unsigned ipv6only:2;
|
||||
unsigned ipv6only:1;
|
||||
#endif
|
||||
unsigned keepalive:2;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue