diff options
-rw-r--r-- | src/knot/dnssec/zone-events.c | 6 | ||||
-rw-r--r-- | src/knot/zone/contents.c | 3 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/knot/dnssec/zone-events.c b/src/knot/dnssec/zone-events.c index 811b3dc14..87acb32fd 100644 --- a/src/knot/dnssec/zone-events.c +++ b/src/knot/dnssec/zone-events.c @@ -317,7 +317,7 @@ done: if (result == KNOT_EOK) { reschedule->next_sign = schedule_next(&ctx, &keyset, ctx.offline_next_time, ctx.stats->expire); reschedule->plan_dnskey_sync = ctx.policy->has_dnskey_sync; - update->new_cont->dnssec_expire = ctx.stats->expire; + ATOMIC_SET(update->new_cont->dnssec_expire, ctx.stats->expire); update->flags |= UPDATE_SIGNED_FULL; } else { reschedule->next_sign = knot_dnssec_failover_delay(&ctx); @@ -457,7 +457,9 @@ done: if (ctx.policy->has_dnskey_sync) { zone_events_schedule_now(update->zone, ZONE_EVENT_DNSKEY_SYNC); } - update->new_cont->dnssec_expire = knot_time_min(update->zone->contents->dnssec_expire, ctx.stats->expire); + ATOMIC_SET(update->new_cont->dnssec_expire, + (uint64_t)knot_time_min(ATOMIC_GET(update->zone->contents->dnssec_expire), + ctx.stats->expire)); } free_zone_keys(&keyset); diff --git a/src/knot/zone/contents.c b/src/knot/zone/contents.c index 8a32cc87e..e2d00d4c5 100644 --- a/src/knot/zone/contents.c +++ b/src/knot/zone/contents.c @@ -192,6 +192,7 @@ zone_contents_t *zone_contents_new(const knot_dname_t *apex_name, bool use_binod } contents->apex->flags |= NODE_FLAGS_APEX; contents->max_ttl = UINT32_MAX; + ATOMIC_INIT(contents->dnssec_expire, 0); return contents; @@ -522,6 +523,8 @@ void zone_contents_free(zone_contents_t *contents) dnssec_nsec3_params_free(&contents->nsec3_params); additionals_tree_free(contents->adds_tree); + ATOMIC_DEINIT(contents->dnssec_expire); + free(contents); } |