From: Colin Vidal Date: Mon, 8 Sep 2025 13:57:47 +0000 (+0200) Subject: move creation of keystores, kasp list and view outside of exclusive mode X-Git-Tag: v9.21.14~29^2~3 X-Git-Url: http://git.ipfire.org/index.cgi?a=commitdiff_plain;h=e1be2be4efdf13eabee8fa454a5bfbd63bb5c98d;p=thirdparty%2Fbind9.git move creation of keystores, kasp list and view outside of exclusive mode The keystores initialization, the KASP list initialization as well as the initialization of the view no longer depends of any data shared by running "production" objects during re-configuration of the server. This allows us to move those outside (before) the exclusive mode is taken. --- diff --git a/bin/named/server.c b/bin/named/server.c index 993e8f218f6..37cc1dea6ab 100644 --- a/bin/named/server.c +++ b/bin/named/server.c @@ -8161,6 +8161,21 @@ apply_configuration(cfg_parser_t *configparser, cfg_obj_t *config, goto cleanup_aclconfctx; } + result = configure_keystores(config, &keystorelist); + if (result != ISC_R_SUCCESS) { + goto cleanup_keystorelist; + } + + result = configure_kasplist(config, &kasplist, &keystorelist); + if (result != ISC_R_SUCCESS) { + goto cleanup_kasplist; + } + + result = create_views(config, configparser, aclconfctx, &viewlist); + if (result != ISC_R_SUCCESS) { + goto cleanup_viewlist; + } + /* Ensure exclusive access to configuration data. */ isc_loopmgr_pause(); @@ -8771,21 +8786,6 @@ apply_configuration(cfg_parser_t *configparser, cfg_obj_t *config, */ (void)configure_session_key(maps, server, isc_g_mctx, first_time); - result = configure_keystores(config, &keystorelist); - if (result != ISC_R_SUCCESS) { - goto cleanup_keystorelist; - } - - result = configure_kasplist(config, &kasplist, &keystorelist); - if (result != ISC_R_SUCCESS) { - goto cleanup_kasplist; - } - - result = create_views(config, configparser, aclconfctx, &viewlist); - if (result != ISC_R_SUCCESS) { - goto cleanup_viewlist; - } - result = configure_views(config, bindkeys, aclconfctx, &viewlist, &cachelist, &kasplist, server, first_time); if (result != ISC_R_SUCCESS) { @@ -9258,6 +9258,22 @@ cleanup_cachelist: isc_mem_put(server->mctx, nsc, sizeof(*nsc)); } +cleanup_portsets: + isc_portset_destroy(isc_g_mctx, &v6portset); + isc_portset_destroy(isc_g_mctx, &v4portset); + +cleanup_bindkeys_parser: + if (bindkeys_parser != NULL) { + if (bindkeys != NULL) { + cfg_obj_destroy(bindkeys_parser, &bindkeys); + } + cfg_parser_destroy(&bindkeys_parser); + } + + if (exclusive) { + isc_loopmgr_resume(); + } + cleanup_viewlist: ISC_LIST_FOREACH(viewlist, view, link) { ISC_LIST_UNLINK(viewlist, view, link); @@ -9281,22 +9297,6 @@ cleanup_keystorelist: dns_keystore_detach(&keystore); } -cleanup_portsets: - isc_portset_destroy(isc_g_mctx, &v6portset); - isc_portset_destroy(isc_g_mctx, &v4portset); - -cleanup_bindkeys_parser: - if (bindkeys_parser != NULL) { - if (bindkeys != NULL) { - cfg_obj_destroy(bindkeys_parser, &bindkeys); - } - cfg_parser_destroy(&bindkeys_parser); - } - - if (exclusive) { - isc_loopmgr_resume(); - } - cleanup_aclconfctx: if (aclconfctx != NULL) { cfg_aclconfctx_detach(&aclconfctx);