mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-01 06:55:30 +00:00
netmgr: have a single source of truth for tcpdns callback
We pass interface as an opaque argument to tcpdns listening socket. If we stop listening on an interface but still have in-flight connections the opaque 'interface' is not properly reference counted, and we might hit a dead memory. We put just a single source of truth in a listening socket and make the child sockets use that instead of copying the value from listening socket. We clean the callback when we stop listening.
This commit is contained in:
@@ -1625,6 +1625,11 @@ ns__client_request(isc_nmhandle_t *handle, isc_region_t *region, void *arg) {
|
||||
ifp = (ns_interface_t *) arg;
|
||||
|
||||
mgr = ifp->clientmgr;
|
||||
if (mgr == NULL) {
|
||||
/* The interface was shut down in the meantime, just bail */
|
||||
return;
|
||||
}
|
||||
|
||||
REQUIRE(VALID_MANAGER(mgr));
|
||||
|
||||
client = isc_nmhandle_getdata(handle);
|
||||
|
Reference in New Issue
Block a user