mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-08 17:42:04 -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.
This commit is contained in:
parent
d2ecff3c4a
commit
a87859f1fa
1 changed files with 2 additions and 0 deletions
|
|
@ -2480,6 +2480,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);
|
||||
|
|
@ -2487,6 +2488,7 @@ final:
|
|||
oldcatz->db_registered = true;
|
||||
}
|
||||
}
|
||||
UNLOCK(&catzs->lock);
|
||||
|
||||
exit:
|
||||
catz->updateresult = result;
|
||||
|
|
|
|||
Loading…
Reference in a new issue