2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 14:07:59 +00:00

Expire names in shutdown_names() under the lock

Since there could be fetches running, we need to run expire_name() under
the lock when shutting down the names.
This commit is contained in:
Ondřej Surý 2022-12-14 15:07:58 +01:00
parent 32c2acf6fc
commit b8c7dc2dc2
No known key found for this signature in database
GPG Key ID: 2820F37E873DEA41

View File

@ -766,6 +766,8 @@ shutdown_names(dns_adb_t *adb) {
name = next)
{
next = ISC_LIST_NEXT(name, link);
dns_adbname_ref(name);
LOCK(&name->lock);
/*
* Run through the list. For each name, clean up finds
* found there, and cancel any fetches running. When
@ -773,6 +775,8 @@ shutdown_names(dns_adb_t *adb) {
* itself.
*/
expire_name(name, DNS_EVENT_ADBSHUTDOWN, INT_MAX);
UNLOCK(&name->lock);
dns_adbname_detach(&name);
}
UNLOCK(&adb->names_lock);
}