changeset 6169:f654addf0eea

Stream: fixed "reuseport" to actually work.
author Ruslan Ermilov <ru@nginx.com>
date Fri, 05 Jun 2015 23:03:13 +0300
parents 62869a9b2e7d
children c13091e6292c
files src/stream/ngx_stream.c src/stream/ngx_stream.h
diffstat 2 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/stream/ngx_stream.c
+++ b/src/stream/ngx_stream.c
@@ -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 *
             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;
--- a/src/stream/ngx_stream.h
+++ b/src/stream/ngx_stream.h
@@ -109,6 +109,9 @@ typedef struct {
 #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)
     int                     tcp_keepidle;