]> 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 05:28:42 +0000 (16:28 +1100)
(cherry picked from commit aaaa7e67fa2b0ec618ec4be1af175fd6d73b76a0)

lib/dns/zone.c

index 163ab4e33c1606ff43fe732e74e5c1137bcbc8f2..54b2ad967cdf29b6e2b3a90d145cf4321da62559 100644 (file)
@@ -18341,10 +18341,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);
@@ -18462,10 +18463,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);
 
        /*