Commit 73f4c7fa authored by Daniel Salzman's avatar Daniel Salzman

zone: invalidate possible control transaction during zone commit

parent e24762c0
......@@ -442,9 +442,7 @@ static void zone_txn_update_clear(zone_t *zone)
{
assert(zone->control_update);
zone_update_clear(zone->control_update);
free(zone->control_update);
zone->control_update = NULL;
zone_control_clear(zone);
}
static int zone_txn_commit(zone_t *zone, ctl_args_t *args)
......
......@@ -280,11 +280,6 @@ int event_load(conf_t *conf, zone_t *zone)
log_zone_info(zone->name, "loaded, serial %s -> %u%s, %zu bytes",
old_serial_str, middle_serial, new_serial_str, zone->contents->size);
if (zone->control_update != NULL) {
log_zone_warning(zone->name, "control transaction aborted");
zone_control_clear(zone);
}
// Schedule depedent events.
const knot_rdataset_t *soa = zone_soa(zone);
zone->timers.soa_expire = knot_soa_expire(soa->rdata);
......
......@@ -749,6 +749,12 @@ int zone_update_commit(conf_t *conf, zone_update_t *update)
update->zone->zonefile.resigned = true;
}
/* Abort control transaction if any. */
if (update->zone->control_update != NULL) {
log_zone_warning(update->zone->name, "control transaction aborted");
zone_control_clear(update->zone);
}
/* Switch zone contents. */
zone_contents_t *old_contents;
old_contents = zone_switch_contents(update->zone, update->new_cont);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment