From c584899b1ac2abf1c8a84b3af26b939cfff12da2 Mon Sep 17 00:00:00 2001 From: Aram Sargsyan Date: Thu, 9 Nov 2023 08:33:35 +0000 Subject: [PATCH] Fix catz db update callback registration logic error (take two) Please see the 998765fea536daacfba96d8ed0a4855668d2e242 commit for the description of the original issue. The commit had fixed the logic error, but it was reintroduced again later with the a1afa31a5a7d318508efe5a32001104d094be057 commit, where the check of the 'db_registered' flag was removed in dns__catz_update_cb(). The check was removed, because the registration function was made idempotent, so double registration is not an issue, but the check also prevented from unneeded registration, on which the original fix relied. This commit just removes the update callback registration code from the dns__catz_update_cb() function instead of bringing back the check, because after code flow analysis, it is now clear that it's not required at all. The "call onupdate() artificially" comment (which was mentioned by the removed code) is speaking about the dns_catz_dbupdate_callback() function, which is called by server.c on (re)configuration, and that function already takes care of update callback's registration since the 998765fea536daacfba96d8ed0a4855668d2e242 commit was applied, so there is no need to do that here again. --- lib/dns/catz.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/lib/dns/catz.c b/lib/dns/catz.c index 5671f3c962..809259b7bb 100644 --- a/lib/dns/catz.c +++ b/lib/dns/catz.c @@ -2493,15 +2493,6 @@ dns__catz_update_cb(void *data) { ISC_LOG_DEBUG(3), "catz: update_from_db: new zone merged"); - /* - * When we're doing reconfig and setting a new catalog zone - * from an existing zone we won't have a chance to set up - * update callback in zone_startload or axfr_makedb, but we will - * call onupdate() artificially so we can register the callback here. - */ - dns_db_updatenotify_register(updb, dns_catz_dbupdate_callback, - oldcatz->catzs); - exit: catz->updateresult = result; }