mirror of
https://github.com/nginx/nginx.git
synced 2024-12-05 06:19:01 +08:00
fix IPv6 and Unix domain sockets inheritance while online upgrade
This commit is contained in:
parent
11f4ad3ec2
commit
23f904ea06
@ -96,14 +96,12 @@ ngx_set_inherited_sockets(ngx_cycle_t *cycle)
|
||||
ls = cycle->listening.elts;
|
||||
for (i = 0; i < cycle->listening.nelts; i++) {
|
||||
|
||||
/* AF_INET only */
|
||||
|
||||
ls[i].sockaddr = ngx_palloc(cycle->pool, sizeof(struct sockaddr_in));
|
||||
ls[i].sockaddr = ngx_palloc(cycle->pool, NGX_SOCKADDRLEN);
|
||||
if (ls[i].sockaddr == NULL) {
|
||||
return NGX_ERROR;
|
||||
}
|
||||
|
||||
ls[i].socklen = sizeof(struct sockaddr_in);
|
||||
ls[i].socklen = NGX_SOCKADDRLEN;
|
||||
if (getsockname(ls[i].fd, ls[i].sockaddr, &ls[i].socklen) == -1) {
|
||||
ngx_log_error(NGX_LOG_CRIT, cycle->log, ngx_socket_errno,
|
||||
"getsockname() of the inherited "
|
||||
|
Loading…
Reference in New Issue
Block a user