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

lib/dns/zone.c

index bfa12a276916bfbecf48659fff74cb3dbad85020..88f56eb48119d0336dc963198664d73f14b5d890 100644 (file)
@@ -18736,10 +18736,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);
@@ -18870,10 +18871,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);
 
        /*