fix IPv6 and Unix domain sockets inheritance while online upgrade

This commit is contained in:
Igor Sysoev 2010-05-31 14:49:11 +00:00
parent 11f4ad3ec2
commit 23f904ea06

View File

@ -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 "