]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
3647. [bug] Address a race condition when shutting down a zone.
authorMark Andrews <marka@isc.org>
Thu, 12 Sep 2013 03:37:43 +0000 (13:37 +1000)
committerMark Andrews <marka@isc.org>
Thu, 12 Sep 2013 03:37:43 +0000 (13:37 +1000)
                        [RT #34750]

CHANGES
lib/dns/zone.c

diff --git a/CHANGES b/CHANGES
index a2a2b00521fc889cd605d2d6326e0c052e236410..660fce114067794cee7e9c074413664bd37c8b01 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+3647.  [bug]           Address a race condition when shutting down a zone.
+                       [RT #34750]
+
 3646.  [bug]           Journal filename string could be set incorrectly,
                         causing garbage in log messages.  [RT #34738]
 
index 1cd0df9487f7133114d38c0ac08769e77873564a..0f632a05b4734591272fcc55932951572e0f211b 100644 (file)
@@ -1000,6 +1000,7 @@ zone_free(dns_zone_t *zone) {
        REQUIRE(zone->irefs == 0);
        REQUIRE(!LOCKED_ZONE(zone));
        REQUIRE(zone->timer == NULL);
+       REQUIRE(zone->zmgr == NULL);
 
        /*
         * Managed objects.  Order is important.
@@ -1014,8 +1015,6 @@ zone_free(dns_zone_t *zone) {
                isc_task_detach(&zone->task);
        if (zone->loadtask != NULL)
                isc_task_detach(&zone->loadtask);
-       if (zone->zmgr != NULL)
-               dns_zonemgr_releasezone(zone->zmgr, zone);
 
        /* Unmanaged objects */
        for (signing = ISC_LIST_HEAD(zone->signing);
@@ -11753,6 +11752,7 @@ zone_shutdown(isc_task_t *task, isc_event_t *event) {
                        zone->statelist = NULL;
                }
                RWUNLOCK(&zone->zmgr->rwlock, isc_rwlocktype_write);
+               dns_zonemgr_releasezone(zone->zmgr, zone);
        }
 
        /*