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

update stream sockets with bound address/port

when isc_nm_listenstreamdns() is called with a local port of 0,
a random port is chosen. call uv_getsockname() to determine what
the port is as soon as the socket is bound, and add a function
isc_nmsocket_getaddr() to retrieve it, so that the caller can
connect to the listening socket. this will be used in cases
where the same process is acting as both client and server.
This commit is contained in:
Evan Hunt
2023-01-31 13:30:12 -08:00
parent 4ad95e0567
commit fe7ed2ba24
5 changed files with 40 additions and 0 deletions

View File

@@ -2538,6 +2538,12 @@ isc_nmhandle_set_tcp_nodelay(isc_nmhandle_t *handle, const bool value) {
return (result);
}
isc_sockaddr_t
isc_nmsocket_getaddr(isc_nmsocket_t *sock) {
REQUIRE(VALID_NMSOCK(sock));
return (sock->iface);
}
#if ISC_NETMGR_TRACE
/*
* Dump all active sockets in netmgr. We output to stderr