mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-14 00:10:00 -04:00
catz: protect db_registered and db callback (un)registration with a lock
Doing this to avoid a race between the 'dns__catz_update_cb()' and
'dns_catz_dbupdate_callback()' functions.
(cherry picked from commit a87859f1fa)
This commit is contained in:
parent
574682b8c7
commit
d6001423af
1 changed files with 2 additions and 0 deletions
|
|
@ -2500,6 +2500,7 @@ final:
|
|||
* update callback in zone_startload or axfr_makedb, but we will
|
||||
* call onupdate() artificially so we can register the callback here.
|
||||
*/
|
||||
LOCK(&catzs->lock);
|
||||
if (!oldcatz->db_registered) {
|
||||
result = dns_db_updatenotify_register(
|
||||
updb, dns_catz_dbupdate_callback, oldcatz->catzs);
|
||||
|
|
@ -2507,6 +2508,7 @@ final:
|
|||
oldcatz->db_registered = true;
|
||||
}
|
||||
}
|
||||
UNLOCK(&catzs->lock);
|
||||
|
||||
exit:
|
||||
catz->updateresult = result;
|
||||
|
|
|
|||
Loading…
Reference in a new issue