aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRuslan Ermilov <ru@nginx.com>2016-08-22 11:40:10 +0300
committerRuslan Ermilov <ru@nginx.com>2016-08-22 11:40:10 +0300
commitd4f70116883792bd902a1761c8a09cdee042e27a (patch)
tree5d1d538e5c356ec693d5fb08b0ae1c6ced73cc2f /src
parentdabbf30377d422a0e40093e3f429fca352c633a1 (diff)
downloadnginx-d4f70116883792bd902a1761c8a09cdee042e27a.tar.gz
nginx-d4f70116883792bd902a1761c8a09cdee042e27a.zip
Events: fixed setting of IP_BIND_ADDRESS_NO_PORT/SO_REUSEADDR.
The IP_BIND_ADDRESS_NO_PORT option is set on upstream sockets if proxy_bind does not specify a port. The SO_REUSEADDR option is set on UDP upstream sockets if proxy_bind specifies a port. Due to checking of the wrong port, IP_BIND_ADDRESS_NO_PORT was never set, and SO_REUSEPORT was always set.
Diffstat (limited to 'src')
-rw-r--r--src/event/ngx_event_connect.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/event/ngx_event_connect.c b/src/event/ngx_event_connect.c
index 30cb59a04..06534ef06 100644
--- a/src/event/ngx_event_connect.c
+++ b/src/event/ngx_event_connect.c
@@ -91,7 +91,7 @@ ngx_event_connect_peer(ngx_peer_connection_t *pc)
#endif
#if (NGX_HAVE_IP_BIND_ADDRESS_NO_PORT || NGX_LINUX)
- port = ngx_inet_get_port(pc->sockaddr);
+ port = ngx_inet_get_port(pc->local->sockaddr);
#endif
#if (NGX_HAVE_IP_BIND_ADDRESS_NO_PORT)