Merge branch '4136-catz-db-update-notify-bug-9.18' into 'bind-9.18'

[9.18] Fix catz db update callback registration logic error

See merge request isc-projects/bind9!8030
This commit is contained in:
Arаm Sаrgsyаn 2023-06-14 09:25:44 +00:00
commit 025110b07a
2 changed files with 13 additions and 4 deletions

View file

@ -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]
6188. [performance] Reduce memory consumption by allocating properly
sized send buffers for stream-based transports.
[GL #4038]

View file

@ -2146,20 +2146,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;
}
}
dns_name_format(&catz->name, dname, DNS_NAME_FORMATSIZE);