]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
3303. [bug] named could die when reloading. [RT #28606]
authorMark Andrews <marka@isc.org>
Thu, 5 Apr 2012 05:48:43 +0000 (15:48 +1000)
committerMark Andrews <marka@isc.org>
Thu, 5 Apr 2012 05:48:43 +0000 (15:48 +1000)
CHANGES
bin/named/server.c
lib/dns/zt.c

diff --git a/CHANGES b/CHANGES
index 5dfe715e70bff64777b6700a07ba82c9c6634cd8..dc6e4ae841ec3828da4443c7fce9a91aac0db4a2 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,5 @@
+3303.  [bug]           named could die when reloading. [RT #28606]
+
 3302.  [bug]           dns_dnssec_findmatchingkeys could fail to find
                        keys if the zone name contained character that
                        required special mappings. [RT #28600]
index 7c791f7b415c128d834b744089a189106029c45c..b4e6036914e3a553f8c4bfd4911e19dfb44255bb 100644 (file)
@@ -5273,17 +5273,28 @@ load_zones(ns_server_t *server) {
             view != NULL;
             view = ISC_LIST_NEXT(view, link))
        {
-               if (view->managed_keys != NULL)
-                       CHECK(dns_zone_load(view->managed_keys));
-               if (view->redirect != NULL)
-                       CHECK(dns_zone_load(view->redirect));
+               if (view->managed_keys != NULL) {
+                       result = dns_zone_load(view->managed_keys);
+                       if (result != ISC_R_SUCCESS && result != DNS_R_UPTODATE)
+                               goto cleanup;
+               }
+               if (view->redirect != NULL) {
+                       result = dns_zone_load(view->redirect);
+                       if (result != ISC_R_SUCCESS && result != DNS_R_UPTODATE)
+                               goto cleanup;
+               }
+
+               /*
+                * 'dns_view_asyncload' calls view_loaded if there are no
+                * zones.
+                */
                isc_refcount_increment(&zl->refs, NULL);
                CHECK(dns_view_asyncload(view, view_loaded, zl));
        }
 
  cleanup:
        isc_refcount_decrement(&zl->refs, &refs);
-       if (result != ISC_R_SUCCESS || refs == 0) {
+       if (refs == 0) {
                isc_refcount_destroy(&zl->refs);
                isc_mem_put(server->mctx, zl, sizeof (*zl));
        } else {
index 68cae251fa1e9919385438fa92f5c138eb5f585b..5bb4cb8b5beadc94a5afdea730f590da516b900f 100644 (file)
@@ -266,7 +266,7 @@ load(dns_zone_t *zone, void *uap) {
 
 isc_result_t
 dns_zt_asyncload(dns_zt_t *zt, dns_zt_allloaded_t alldone, void *arg) {
-       isc_result_t result, tresult;
+       isc_result_t result;
        static dns_zt_zoneloaded_t dl = doneloading;
        int pending;
 
@@ -276,7 +276,7 @@ dns_zt_asyncload(dns_zt_t *zt, dns_zt_allloaded_t alldone, void *arg) {
 
        INSIST(zt->loads_pending == 0);
 
-       result = dns_zt_apply2(zt, ISC_FALSE, &tresult, asyncload, &dl);
+       result = dns_zt_apply2(zt, ISC_FALSE, NULL, asyncload, &dl);
 
        pending = zt->loads_pending;
        if (pending != 0) {