2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 22:15:20 +00:00

isc_nm_listentcp: treat socket failures gracefully

The old code didn't handle race conditions and errors on systems
with non load balancing sockets gracefully.  Look for an error on
any child socket and if found close all the child sockets and return
an error.
This commit is contained in:
Mark Andrews
2023-01-17 17:47:32 +11:00
parent 624f5a0dae
commit 08c39736a9

View File

@@ -431,8 +431,16 @@ isc_nm_listentcp(isc_nm_t *mgr, uint32_t workers, isc_sockaddr_t *iface,
isc__nm_closesocket(fd);
}
/*
* If any of the child sockets have failed then isc_nm_listentcp
* fails.
*/
for (size_t i = 1; i < sock->nchildren; i++) {
INSIST(result == sock->children[i].result);
if (result == ISC_R_SUCCESS &&
sock->children[i].result != ISC_R_SUCCESS)
{
result = sock->children[i].result;
}
}
atomic_store(&sock->active, true);