Skip to content

Commit

Permalink
fix: replace socket call swap w/ fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
mux99 committed Mar 15, 2024
1 parent 1ceecf5 commit b087858
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/core/ngx_connection.c
Expand Up @@ -489,11 +489,14 @@ ngx_open_listening_sockets(ngx_cycle_t *cycle)
}

#if (NGX_HAVE_MPTCP)
s = ngx_socket(ls[i].sockaddr->sa_family, ls[i].type,
s = (ngx_socket_t) -1;
if (ls[i].protocol > 0)
s = ngx_socket(ls[i].sockaddr->sa_family, ls[i].type,
ls[i].protocol);
#else
s = ngx_socket(ls[i].sockaddr->sa_family, ls[i].type, 0);
if (s == (ngx_socket_t) -1)
#endif
s = ngx_socket(ls[i].sockaddr->sa_family, ls[i].type, 0);

if (s == (ngx_socket_t) -1) {
ngx_log_error(NGX_LOG_EMERG, log, ngx_socket_errno,
ngx_socket_n " %V failed", &ls[i].addr_text);
Expand Down

0 comments on commit b087858

Please sign in to comment.