Stream: fixed "reuseport" to actually work.

This commit is contained in:
Ruslan Ermilov 2015-06-05 23:03:13 +03:00
parent 652fb06a66
commit 82f43aeb19
2 changed files with 10 additions and 0 deletions

View File

@ -314,6 +314,9 @@ found:
#if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
addr->ipv6only = listen->ipv6only;
#endif
#if (NGX_HAVE_REUSEPORT)
addr->reuseport = listen->reuseport;
#endif
return NGX_OK;
}
@ -386,6 +389,10 @@ ngx_stream_optimize_servers(ngx_conf_t *cf, ngx_array_t *ports)
ls->ipv6only = addr[i].ipv6only;
#endif
#if (NGX_HAVE_REUSEPORT)
ls->reuseport = addr[i].reuseport;
#endif
stport = ngx_palloc(cf->pool, sizeof(ngx_stream_port_t));
if (stport == NULL) {
return NGX_CONF_ERROR;

View File

@ -108,6 +108,9 @@ typedef struct {
#endif
#if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
unsigned ipv6only:1;
#endif
#if (NGX_HAVE_REUSEPORT)
unsigned reuseport:1;
#endif
unsigned so_keepalive:2;
#if (NGX_HAVE_KEEPALIVE_TUNABLE)