2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-05 09:05:40 +00:00

Merge branch '3800-macos-address-in-use-not-handled-gracefully' into 'main'

Resolve "MacOS address in use not handled gracefully"

Closes #3800

See merge request isc-projects/bind9!7381
This commit is contained in:
Mark Andrews
2023-01-20 13:29:19 +00:00
3 changed files with 23 additions and 4 deletions

View File

@@ -1,3 +1,6 @@
6076. [bug] Handle OS errors when creating UDP and TCP sockets
more gracefully. [GL #3800]
6075. [bug] Add missing node lock when setting node->wild in
add_wildcard_magic. [GL #3799]

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);

View File

@@ -110,7 +110,7 @@ start_udp_child(isc_nm_t *mgr, isc_sockaddr_t *iface, isc_nmsocket_t *sock,
} else {
csock->fd = dup(fd);
}
REQUIRE(csock->fd >= 0);
INSIST(csock->fd >= 0);
ievent = isc__nm_get_netievent_udplisten(worker, csock);
@@ -177,8 +177,16 @@ isc_nm_listenudp(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_listenudp
* 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);
@@ -190,7 +198,7 @@ isc_nm_listenudp(isc_nm_t *mgr, uint32_t workers, isc_sockaddr_t *iface,
return (result);
}
REQUIRE(atomic_load(&sock->rchildren) == sock->nchildren);
INSIST(atomic_load(&sock->rchildren) == sock->nchildren);
*sockp = sock;
return (ISC_R_SUCCESS);
}