Commit 068724f4 authored by Marek Vavrusa's avatar Marek Vavrusa

axfr/ixfr: lock RCU for multipacket answers

(processing locks RCU per-response, but zone content must not change
 during the iterations)
parent 7527b834
......@@ -106,6 +106,9 @@ static void axfr_answer_cleanup(struct query_data *qdata)
ptrlist_free(&axfr->nodes, mm);
mm->free(axfr);
/* Allow zone changes (finished). */
rcu_read_unlock();
}
static int axfr_answer_init(struct query_data *qdata)
......@@ -130,6 +133,10 @@ static int axfr_answer_init(struct query_data *qdata)
/* Set up cleanup callback. */
qdata->ext = xfer;
qdata->ext_cleanup = &axfr_answer_cleanup;
/* No zone changes during multipacket answer (unlocked in axfr_answer_cleanup) */
rcu_read_lock();
return KNOT_EOK;
}
......
......@@ -186,6 +186,9 @@ static void ixfr_answer_cleanup(struct query_data *qdata)
ptrlist_free(&ixfr->proc.nodes, mm);
knot_changesets_free(&ixfr->changesets);
mm->free(qdata->ext);
/* Allow zone changes (finished). */
rcu_read_unlock();
}
static int ixfr_answer_init(struct query_data *qdata)
......@@ -239,6 +242,9 @@ static int ixfr_answer_init(struct query_data *qdata)
qdata->ext = xfer;
qdata->ext_cleanup = &ixfr_answer_cleanup;
/* No zone changes during multipacket answer (unlocked in axfr_answer_cleanup) */
rcu_read_lock();
return KNOT_EOK;
}
......
......@@ -1739,7 +1739,7 @@ int zones_schedule_dnssec(zone_t *zone, time_t unixtime)
void zones_schedule_zonefile_sync(zone_t *zone, uint32_t timeout)
{
if (zone != NULL) {
dbg_zones("zone: SYNC '%s' set to %"PRIi64"\n",
dbg_zones("zone: SYNC '%s' set to %u\n",
zone->conf->name, timeout);
evsched_schedule(zone->ixfr_dbsync, timeout);
}
......
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