]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Adjust lock/unlock in zone_rekey()
authorOndřej Surý <ondrej@isc.org>
Thu, 27 Feb 2020 07:45:10 +0000 (08:45 +0100)
committerMark Andrews <marka@isc.org>
Tue, 3 Mar 2020 04:26:31 +0000 (15:26 +1100)
lib/dns/zone.c

index aec813d281379cae84613caf8ff48651a703e85d..18b5172a1554e5d3b53fd918d36ca8e024ea9762 100644 (file)
@@ -19514,10 +19514,11 @@ zone_rekey(dns_zone_t *zone) {
 
        dns_db_closeversion(db, &ver, true);
 
+       LOCK_ZONE(zone);
+
        if (commit) {
                dns_difftuple_t *tuple;
 
-               LOCK_ZONE(zone);
                DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_NEEDNOTIFY);
 
                zone_needdump(zone, DNS_DUMP_DELAY);
@@ -19639,10 +19640,8 @@ zone_rekey(dns_zone_t *zone) {
                 * Schedule the next resigning event
                 */
                set_resigntime(zone);
-               UNLOCK_ZONE(zone);
        }
 
-       LOCK_ZONE(zone);
        isc_time_settoepoch(&zone->refreshkeytime);
 
        /*