aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_core_module.c
diff options
context:
space:
mode:
authorSergey Kandaurov <pluknet@nginx.com>2022-12-15 19:40:44 +0400
committerSergey Kandaurov <pluknet@nginx.com>2022-12-15 19:40:44 +0400
commita1bb12e14ee86fdac2877c3a834b604f5bc522ae (patch)
treedae9169a2741a019c4840d8d5ab578bc78d30786 /src/http/ngx_http_core_module.c
parent36f7b31f9578c0d393cfe82d4e23c76a7539f34e (diff)
parent8e9f7e89b819702532803f10f728b070f8ee2617 (diff)
downloadnginx-a1bb12e14ee86fdac2877c3a834b604f5bc522ae.tar.gz
nginx-a1bb12e14ee86fdac2877c3a834b604f5bc522ae.zip
Merged with the default branch.
Diffstat (limited to 'src/http/ngx_http_core_module.c')
-rw-r--r--src/http/ngx_http_core_module.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
index 248fa80ea..e988a4ca7 100644
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -3964,7 +3964,7 @@ ngx_http_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
ngx_str_t *value, size;
ngx_url_t u;
- ngx_uint_t n;
+ ngx_uint_t n, i;
ngx_http_listen_opt_t lsopt;
cscf->listen = 1;
@@ -4310,6 +4310,16 @@ ngx_http_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
#endif
for (n = 0; n < u.naddrs; n++) {
+
+ for (i = 0; i < n; i++) {
+ if (ngx_cmp_sockaddr(u.addrs[n].sockaddr, u.addrs[n].socklen,
+ u.addrs[i].sockaddr, u.addrs[i].socklen, 0)
+ == NGX_OK)
+ {
+ goto next;
+ }
+ }
+
lsopt.sockaddr = u.addrs[n].sockaddr;
lsopt.socklen = u.addrs[n].socklen;
lsopt.addr_text = u.addrs[n].name;
@@ -4318,6 +4328,9 @@ ngx_http_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
if (ngx_http_add_listen(cf, cscf, &lsopt) != NGX_OK) {
return NGX_CONF_ERROR;
}
+
+ next:
+ continue;
}
return NGX_CONF_OK;