Welcome! Log In Create A New Profile

Advanced

[nginx] Events: fixed setting of IP_BIND_ADDRESS_NO_PORT/SO_REUSEADDR.

August 22, 2016 06:20AM
details: http://hg.nginx.org/nginx/rev/7fd6b93face8
branches:
changeset: 6658:7fd6b93face8
user: Ruslan Ermilov <ru@nginx.com>
date: Mon Aug 22 11:40:10 2016 +0300
description:
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:

src/event/ngx_event_connect.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r 3d5202c71f94 -r 7fd6b93face8 src/event/ngx_event_connect.c
--- a/src/event/ngx_event_connect.c Wed Aug 17 11:26:51 2016 +0300
+++ b/src/event/ngx_event_connect.c Mon Aug 22 11:40:10 2016 +0300
@@ -91,7 +91,7 @@ ngx_event_connect_peer(ngx_peer_connecti
#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)

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] Events: fixed setting of IP_BIND_ADDRESS_NO_PORT/SO_REUSEADDR.

ru@nginx.com 889 August 22, 2016 06:20AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 317
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready