]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
move creation of keystores, kasp list and view outside of exclusive mode
authorColin Vidal <colin@isc.org>
Mon, 8 Sep 2025 13:57:47 +0000 (15:57 +0200)
committerColin Vidal <colin@isc.org>
Wed, 24 Sep 2025 08:54:50 +0000 (10:54 +0200)
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.

bin/named/server.c

index 993e8f218f65f71f166cb32940f5ea33001ba7cb..37cc1dea6abcbfefa3504d146d0ac983c0d7a5cb 100644 (file)
@@ -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);