mirror of
https://gitlab.isc.org/isc-projects/bind9.git
synced 2025-04-18 09:44:09 +03:00
Merge branch '4136-catz-db-update-notify-bug' into 'main'
Fix catz db update callback registration logic error Closes #4136 See merge request isc-projects/bind9!8025
This commit is contained in:
commit
589752fc69
6
CHANGES
6
CHANGES
@ -1,3 +1,9 @@
|
||||
6193. [bug] Fix a catz db update notification callback registration
|
||||
logic error, which could crash named when receiving an
|
||||
AXFR update for a catalog zone while the previous update
|
||||
process of the catalog zone was already running.
|
||||
[GL #4136]
|
||||
|
||||
6192. [placeholder]
|
||||
|
||||
6191. [placeholder]
|
||||
|
@ -2147,20 +2147,23 @@ dns_catz_dbupdate_callback(dns_db_t *db, void *fn_arg) {
|
||||
|
||||
/* New zone came as AXFR */
|
||||
if (catz->db != NULL && catz->db != db) {
|
||||
/* Old db cleanup. */
|
||||
if (catz->dbversion != NULL) {
|
||||
dns_db_closeversion(catz->db, &catz->dbversion, false);
|
||||
}
|
||||
dns_db_updatenotify_unregister(
|
||||
catz->db, dns_catz_dbupdate_callback, catz->catzs);
|
||||
dns_db_detach(&catz->db);
|
||||
/*
|
||||
* We're not registering db update callback, it will be
|
||||
* registered at the end of dns__catz_update_cb()
|
||||
*/
|
||||
catz->db_registered = false;
|
||||
}
|
||||
if (catz->db == NULL) {
|
||||
/* New db registration. */
|
||||
dns_db_attach(db, &catz->db);
|
||||
result = dns_db_updatenotify_register(
|
||||
db, dns_catz_dbupdate_callback, catz->catzs);
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
catz->db_registered = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!catz->updatepending && !catz->updaterunning) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user