From: Libor Peltan Date: Tue, 4 Nov 2025 12:58:45 +0000 (+0100) Subject: zone/timers: refactoring: allocated separately from zone_t X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a8ebb5cab81e54fa879bd7286cd3550a2ad33fda;p=thirdparty%2Fknot-dns.git zone/timers: refactoring: allocated separately from zone_t --- diff --git a/src/knot/catalog/generate.c b/src/knot/catalog/generate.c index f12da65f5e..852fe5e623 100644 --- a/src/knot/catalog/generate.c +++ b/src/knot/catalog/generate.c @@ -66,7 +66,7 @@ void catalog_generate_rem(conf_t *conf, zone_t *zone, knot_zonedb_t *db_new) return; } assert(catz->cat_members != NULL); // if this failed to allocate, catz wasn't added to zonedb - knot_dname_t *owner = catalog_member_owner(zone->name, cg, zone->timers.catalog_member); + knot_dname_t *owner = catalog_member_owner(zone->name, cg, zone->timers->catalog_member); if (owner == NULL) { catz->cat_members->error = KNOT_ENOENT; return; @@ -98,7 +98,7 @@ void catalog_generate_add(conf_t *conf, zone_t *zone, knot_zonedb_t *db_new, boo log_zone_error(zone->name, "member zone belongs to non-generated catalog zone"); return; } - knot_dname_t *owner = catalog_member_owner(zone->name, cg, zone->timers.catalog_member); + knot_dname_t *owner = catalog_member_owner(zone->name, cg, zone->timers->catalog_member); if (owner == NULL) { catz->cat_members->error = KNOT_ENOENT; return; diff --git a/src/knot/dnssec/zone-sign.c b/src/knot/dnssec/zone-sign.c index c090ab1129..856c089cf6 100644 --- a/src/knot/dnssec/zone-sign.c +++ b/src/knot/dnssec/zone-sign.c @@ -886,8 +886,8 @@ int knot_zone_sign_update_dnskeys(zone_update_t *update, if (dnssec_ctx->policy->ds_push && node_rrtype_exists(ch.add->apex, KNOT_RRTYPE_CDS)) { // there is indeed a change to CDS - update->zone->timers.next_ds_push = time(NULL) + dnssec_ctx->policy->propagation_delay; - zone_events_schedule_at(update->zone, ZONE_EVENT_DS_PUSH, update->zone->timers.next_ds_push); + update->zone->timers->next_ds_push = time(NULL) + dnssec_ctx->policy->propagation_delay; + zone_events_schedule_at(update->zone, ZONE_EVENT_DS_PUSH, update->zone->timers->next_ds_push); } ret = zone_update_apply_changeset(update, &ch); diff --git a/src/knot/events/handlers/dnssec.c b/src/knot/events/handlers/dnssec.c index e451ce20a5..0150bdd3b6 100644 --- a/src/knot/events/handlers/dnssec.c +++ b/src/knot/events/handlers/dnssec.c @@ -40,7 +40,7 @@ void event_dnssec_reschedule(conf_t *conf, zone_t *zone, log_dnssec_next(zone->name, (time_t)refresh_at); if (refresh->plan_ds_check) { - zone->timers.next_ds_check = now; + zone->timers->next_ds_check = now; } unsigned jitter = dnskey_sync_jitter(conf, zone); diff --git a/src/knot/events/handlers/ds_check.c b/src/knot/events/handlers/ds_check.c index 2a9a5a50f0..f4f8cae2b3 100644 --- a/src/knot/events/handlers/ds_check.c +++ b/src/knot/events/handlers/ds_check.c @@ -24,7 +24,7 @@ int event_ds_check(conf_t *conf, zone_t *zone) ret = knot_parent_ds_query(conf, &ctx, zone->server, conf->cache.srv_tcp_remote_io_timeout); - zone->timers.next_ds_check = 0; + zone->timers->next_ds_check = 0; switch (ret) { case KNOT_NO_READY_KEY: break; @@ -34,7 +34,7 @@ int event_ds_check(conf_t *conf, zone_t *zone) default: if (ctx.policy->ksk_sbm_check_interval > 0) { time_t next_check = time(NULL) + ctx.policy->ksk_sbm_check_interval; - zone->timers.next_ds_check = next_check; + zone->timers->next_ds_check = next_check; zone_events_schedule_at(zone, ZONE_EVENT_DS_CHECK, next_check); } } diff --git a/src/knot/events/handlers/ds_push.c b/src/knot/events/handlers/ds_push.c index 1c53b993fb..deb6392050 100644 --- a/src/knot/events/handlers/ds_push.c +++ b/src/knot/events/handlers/ds_push.c @@ -239,7 +239,7 @@ int event_ds_push(conf_t *conf, zone_t *zone) conf_remote_t parent = conf_remote(conf, iter.id, i); ret = send_ds_push(conf, zone, &parent, timeout); if (ret == KNOT_EOK) { - zone->timers.next_ds_push = 0; + zone->timers->next_ds_push = 0; break; } } @@ -247,7 +247,7 @@ int event_ds_push(conf_t *conf, zone_t *zone) if (ret != KNOT_EOK) { time_t next_push = time(NULL) + DS_PUSH_RETRY; zone_events_schedule_at(zone, ZONE_EVENT_DS_PUSH, next_push); - zone->timers.next_ds_push = next_push; + zone->timers->next_ds_push = next_push; } conf_mix_iter_next(&iter); diff --git a/src/knot/events/handlers/load.c b/src/knot/events/handlers/load.c index 0ca539f720..b19c443bd1 100644 --- a/src/knot/events/handlers/load.c +++ b/src/knot/events/handlers/load.c @@ -485,10 +485,10 @@ load_end: } char expires_in[32] = ""; - if (zone->timers.next_expire > 0) { + if (zone->timers->next_expire > 0) { (void)snprintf(expires_in, sizeof(expires_in), ", expires in %u seconds", - (uint32_t)MAX(zone->timers.next_expire - time(NULL), 0)); + (uint32_t)MAX(zone->timers->next_expire - time(NULL), 0)); } log_zone_info(zone->name, "loaded, serial %s -> %u%s, %zu bytes%s", @@ -505,7 +505,7 @@ load_end: replan_from_timers(conf, zone); - if (!zone_timers_serial_notified(&zone->timers, new_serial)) { + if (!zone_timers_serial_notified(zone->timers, new_serial)) { zone_schedule_notify(conf, zone, 0); } zone_redis_disconnect(db_ctx, true); diff --git a/src/knot/events/handlers/notify.c b/src/knot/events/handlers/notify.c index 1b9a7a7fe2..b8a54232ce 100644 --- a/src/knot/events/handlers/notify.c +++ b/src/knot/events/handlers/notify.c @@ -111,7 +111,7 @@ static int send_notify(conf_t *conf, zone_t *zone, const knot_rrset_t *soa, NOTIFY_OUT_LOG(LOG_INFO, zone->name, slave, requestor.layer.flags, "%sserial %u", log_retry, knot_soa_serial(soa->rrs.rdata)); - zone->timers.last_notified_serial = (knot_soa_serial(soa->rrs.rdata) | LAST_NOTIFIED_SERIAL_VALID); + zone->timers->last_notified_serial = (knot_soa_serial(soa->rrs.rdata) | LAST_NOTIFIED_SERIAL_VALID); } else if (knot_pkt_ext_rcode(req->resp) == 0) { NOTIFY_OUT_LOG(LOG_WARNING, zone->name, slave, requestor.layer.flags, diff --git a/src/knot/events/handlers/refresh.c b/src/knot/events/handlers/refresh.c index 544fbe9c9f..5c0b34bfb3 100644 --- a/src/knot/events/handlers/refresh.c +++ b/src/knot/events/handlers/refresh.c @@ -199,7 +199,7 @@ static void consume_edns_expire(struct refresh_data *data, knot_pkt_t *pkt, bool if (expire_opt != NULL && knot_edns_opt_get_length(expire_opt) == sizeof(uint32_t)) { uint32_t edns_expire = knot_wire_read_u32(knot_edns_opt_get_data(expire_opt)); data->expire_timer = strictly_follow ? edns_expire : - MAX(edns_expire, data->zone->timers.next_expire - time(NULL)); + MAX(edns_expire, data->zone->timers->next_expire - time(NULL)); } } @@ -218,19 +218,19 @@ static void finalize_timers_base(struct refresh_data *data, bool also_expire) uint32_t soa_refresh = knot_soa_refresh(soa->rdata); limit_timer(conf, zone->name, &soa_refresh, "refresh", C_REFRESH_MIN_INTERVAL, C_REFRESH_MAX_INTERVAL); - zone->timers.next_refresh = now + soa_refresh; - zone->timers.last_refresh_ok = true; + zone->timers->next_refresh = now + soa_refresh; + zone->timers->last_refresh_ok = true; if (zone->is_catalog_flag) { // It's already zero in most cases. - zone->timers.next_expire = 0; + zone->timers->next_expire = 0; } else if (also_expire) { limit_timer(conf, zone->name, &data->expire_timer, "expire", // Limit min if not received as EDNS Expire. data->expire_timer == knot_soa_expire(soa->rdata) ? C_EXPIRE_MIN_INTERVAL : 0, C_EXPIRE_MAX_INTERVAL); - zone->timers.next_expire = now + data->expire_timer; + zone->timers->next_expire = now + data->expire_timer; } } @@ -246,8 +246,8 @@ static void finalize_timers_noexpire(struct refresh_data *data) static void fill_expires_in(char *expires_in, size_t size, const struct refresh_data *data) { - assert(!data->zone->is_catalog_flag || data->zone->timers.next_expire == 0); - if (data->zone->timers.next_expire > 0 && data->expire_timer > 0) { + assert(!data->zone->is_catalog_flag || data->zone->timers->next_expire == 0); + if (data->zone->timers->next_expire > 0 && data->expire_timer > 0) { (void)snprintf(expires_in, size, ", expires in %u seconds", data->expire_timer); } @@ -1074,24 +1074,24 @@ static bool wait4pinned_master(struct refresh_data *data) } else if (data->fallback->trying_last) { return false; // Pinned master expected but not yet set, force AXFR (e.g. dropped timers). - } else if (data->zone->timers.last_master.sin6_family == AF_UNSPEC) { + } else if (data->zone->timers->last_master.sin6_family == AF_UNSPEC) { data->xfr_type = XFR_TYPE_AXFR; return false; } time_t now = time(NULL); // Starting countdown for master transition. - if (data->zone->timers.master_pin_hit == 0) { - data->zone->timers.master_pin_hit = now; + if (data->zone->timers->master_pin_hit == 0) { + data->zone->timers->master_pin_hit = now; zone_events_schedule_at(data->zone, ZONE_EVENT_REFRESH, now + data->fallback->pin_tol); // Switch to a new master. - } else if (data->zone->timers.master_pin_hit + data->fallback->pin_tol <= now) { + } else if (data->zone->timers->master_pin_hit + data->fallback->pin_tol <= now) { data->xfr_type = XFR_TYPE_AXFR; return false; // Replan the refresh to the moment when the pin tolerance times out. } else { zone_events_schedule_at(data->zone, ZONE_EVENT_REFRESH, - data->zone->timers.master_pin_hit + data->fallback->pin_tol); + data->zone->timers->master_pin_hit + data->fallback->pin_tol); } return true; @@ -1505,19 +1505,19 @@ int event_refresh(conf_t *conf, zone_t *zone) limit_timer(conf, zone->name, &next, "retry", C_RETRY_MIN_INTERVAL, C_RETRY_MAX_INTERVAL); time_t now = time(NULL); - zone->timers.next_refresh = now + next; - zone->timers.last_refresh_ok = false; + zone->timers->next_refresh = now + next; + zone->timers->last_refresh_ok = false; char time_str[64] = { 0 }; struct tm time_gm = { 0 }; - localtime_r(&zone->timers.next_refresh, &time_gm); + localtime_r(&zone->timers->next_refresh, &time_gm); strftime(time_str, sizeof(time_str), KNOT_LOG_TIME_FORMAT, &time_gm); char expires_in[32] = ""; if (!zone->is_catalog_flag) { struct refresh_data data = { .zone = zone, - .expire_timer = zone->timers.next_expire - now, + .expire_timer = zone->timers->next_expire - now, }; fill_expires_in(expires_in, sizeof(expires_in), &data); } diff --git a/src/knot/events/replan.c b/src/knot/events/replan.c index e219d43833..203ad4db12 100644 --- a/src/knot/events/replan.c +++ b/src/knot/events/replan.c @@ -94,8 +94,8 @@ void replan_from_timers(conf_t *conf, zone_t *zone) time_t refresh = TIME_CANCEL; if (zone_is_slave(conf, zone)) { - refresh = zone->timers.next_refresh; - if (zone->contents == NULL && zone->timers.last_refresh_ok) { // zone disappeared w/o expiry + refresh = zone->timers->next_refresh; + if (zone->contents == NULL && zone->timers->last_refresh_ok) { // zone disappeared w/o expiry refresh = now; } if (refresh == 0) { // sanitize in case of concurrent purge event @@ -108,7 +108,7 @@ void replan_from_timers(conf_t *conf, zone_t *zone) time_t expire = TIME_IGNORE; if (zone_is_slave(conf, zone) && zone->contents != NULL) { expire_pre = TIME_CANCEL; - expire = zone->timers.next_expire; + expire = zone->timers->next_expire; } time_t flush = TIME_IGNORE; @@ -116,7 +116,7 @@ void replan_from_timers(conf_t *conf, zone_t *zone) conf_val_t val = conf_zone_get(conf, C_ZONEFILE_SYNC, zone->name); int64_t sync_timeout = conf_int(&val); if (sync_timeout > 0) { - flush = zone->timers.last_flush + sync_timeout; + flush = zone->timers->last_flush + sync_timeout; } } @@ -143,11 +143,11 @@ void replan_from_timers(conf_t *conf, zone_t *zone) } } - ds_check = zone->timers.next_ds_check; + ds_check = zone->timers->next_ds_check; if (ds_check == 0) { ds_check = TIME_IGNORE; } - ds_push = zone->timers.next_ds_push; + ds_push = zone->timers->next_ds_push; if (ds_push == 0) { ds_push = TIME_IGNORE; } diff --git a/src/knot/nameserver/process_query.c b/src/knot/nameserver/process_query.c index b044260811..f9d79f588a 100644 --- a/src/knot/nameserver/process_query.c +++ b/src/knot/nameserver/process_query.c @@ -353,7 +353,7 @@ static int answer_edns_put(knot_pkt_t *resp, knotd_qdata_t *qdata) if (knot_pkt_edns_option(qdata->query, KNOT_EDNS_OPTION_EXPIRE) != NULL && qdata->extra->contents != NULL && !qdata->extra->zone->is_catalog_flag) { knot_time_t expire = knot_time_min(ATOMIC_GET(qdata->extra->contents->dnssec_expire), - qdata->extra->zone->timers.next_expire); + qdata->extra->zone->timers->next_expire); uint32_t timer; if (expire == 0) { timer = zone_soa_expire(qdata->extra->zone); diff --git a/src/knot/zone/backup.c b/src/knot/zone/backup.c index 49f460b3ed..8ffe1441cb 100644 --- a/src/knot/zone/backup.c +++ b/src/knot/zone/backup.c @@ -494,11 +494,11 @@ int zone_backup(conf_t *conf, zone_t *zone) return ret; } if (ctx->restore_mode) { - ret = zone_timers_read(&ctx->bck_timer_db, zone->name, &zone->timers); + ret = zone_timers_read(&ctx->bck_timer_db, zone->name, zone->timers); zone_timers_sanitize(conf, zone); zone->zonefile.bootstrap_cnt = 0; } else { - ret = zone_timers_write(&ctx->bck_timer_db, zone->name, &zone->timers); + ret = zone_timers_write(&ctx->bck_timer_db, zone->name, zone->timers); } if (ret != KNOT_EOK) { LOG_MARK_FAIL("timers"); diff --git a/src/knot/zone/timers.c b/src/knot/zone/timers.c index 40e3414901..9c88779517 100644 --- a/src/knot/zone/timers.c +++ b/src/knot/zone/timers.c @@ -199,7 +199,7 @@ int zone_timers_write(knot_lmdb_db_t *db, const knot_dname_t *zone, static void txn_zone_write(zone_t *z, knot_lmdb_txn_t *txn) { - txn_write_timers(txn, z->name, &z->timers); + txn_write_timers(txn, z->name, z->timers); } int zone_timers_write_all(knot_lmdb_db_t *db, knot_zonedb_t *zonedb) diff --git a/src/knot/zone/zone.c b/src/knot/zone/zone.c index 8d28ec4b7f..f5c6a25de1 100644 --- a/src/knot/zone/zone.c +++ b/src/knot/zone/zone.c @@ -140,9 +140,9 @@ static int flush_journal(conf_t *conf, zone_t *zone, bool allow_empty_zone, bool flush_journal_replan: /* Plan next journal flush after proper period. */ - zone->timers.last_flush = time(NULL); + zone->timers->last_flush = time(NULL); if (sync_timeout > 0) { - time_t next_flush = zone->timers.last_flush + sync_timeout; + time_t next_flush = zone->timers->last_flush + sync_timeout; zone_events_schedule_at(zone, ZONE_EVENT_FLUSH, (time_t)0, ZONE_EVENT_FLUSH, next_flush); } @@ -164,6 +164,13 @@ zone_t* zone_new(const knot_dname_t *name) return NULL; } + zone->timers = calloc(1, sizeof(*zone->timers)); + if (zone->timers == NULL) { + knot_dname_free(zone->name, NULL); + free(zone); + return NULL; + } + // DDNS pthread_mutex_init(&zone->ddns_lock, NULL); zone->ddns_queue_size = 0; @@ -247,6 +254,7 @@ void zone_free(zone_t **zone_ptr) ATOMIC_DEINIT(zone->backup_ctx); + free(zone->timers); free(zone); *zone_ptr = NULL; } @@ -297,13 +305,13 @@ int selective_zone_purge(conf_t *conf, zone_t *zone, purge_flag_t params) // Purge the zone timers. if (params & PURGE_ZONE_TIMERS) { - bool member = (zone->catalog_gen != NULL); - zone->timers = (zone_timers_t) { - .catalog_member = member ? zone->timers.catalog_member : 0 - }; + time_t member = (zone->catalog_gen != NULL ? zone->timers->catalog_member : 0); + memset(zone->timers, 0, sizeof(*zone->timers)); + zone->timers->catalog_member = member; + if (member) { ret = zone_timers_write(&zone->server->timerdb, zone->name, - &zone->timers); + zone->timers); } else { ret = zone_timers_sweep(&zone->server->timerdb, dname_cmp_sweep_wrap, zone->name); @@ -379,8 +387,8 @@ void zone_perform_expire(conf_t *conf, zone_t *zone) zone_set_last_master(zone, NULL); - zone->timers.next_expire = time(NULL); - zone->timers.next_refresh = zone->timers.next_expire; + zone->timers->next_expire = time(NULL); + zone->timers->next_refresh = zone->timers->next_expire; replan_from_timers(conf, zone); } @@ -585,11 +593,11 @@ void zone_set_last_master(zone_t *zone, const struct sockaddr_storage *addr) } if (addr == NULL) { - memset(&zone->timers.last_master, 0, sizeof(zone->timers.last_master)); + memset(&zone->timers->last_master, 0, sizeof(zone->timers->last_master)); } else { - memcpy(&zone->timers.last_master, addr, sizeof(zone->timers.last_master)); + memcpy(&zone->timers->last_master, addr, sizeof(zone->timers->last_master)); } - zone->timers.master_pin_hit = 0; + zone->timers->master_pin_hit = 0; } static void set_flag(zone_t *zone, zone_flag_t flag, bool remove) @@ -655,9 +663,7 @@ bool zone_expired(const zone_t *zone) return false; } - const zone_timers_t *timers = &zone->timers; - - return timers->next_expire > 0 && timers->next_expire <= time(NULL); + return zone->timers->next_expire > 0 && zone->timers->next_expire <= time(NULL); } static void time_set_default(time_t *time, time_t value) @@ -677,20 +683,20 @@ void zone_timers_sanitize(conf_t *conf, zone_t *zone) time_t now = time(NULL); // assume now if we don't know when we flushed - time_set_default(&zone->timers.last_flush, now); + time_set_default(&zone->timers->last_flush, now); if (zone_is_slave(conf, zone)) { // assume now if we don't know - time_set_default(&zone->timers.next_refresh, now); + time_set_default(&zone->timers->next_refresh, now); if (zone->is_catalog_flag) { - zone->timers.next_expire = 0; + zone->timers->next_expire = 0; } } else { // invalidate if we don't have a master - zone->timers.last_refresh = 0; - zone->timers.next_refresh = 0; - zone->timers.last_refresh_ok = false; - zone->timers.next_expire = 0; + zone->timers->last_refresh = 0; + zone->timers->next_refresh = 0; + zone->timers->last_refresh_ok = false; + zone->timers->next_expire = 0; } } @@ -760,7 +766,7 @@ int zone_master_try(conf_t *conf, zone_t *zone, zone_master_cb callback, preferred_2x = (zone->flags & ZONE_PREF_MASTER_2X); } if (pin_tolerance > 0 && - sockaddr_net_match(&remote.addr, (struct sockaddr_storage *)&zone->timers.last_master, -1)) { + sockaddr_net_match(&remote.addr, (struct sockaddr_storage *)&zone->timers->last_master, -1)) { last_id = conf_str(iter.id); last = *iter.id; last_idx = idx; @@ -919,20 +925,20 @@ int zone_get_master_serial(zone_t *zone, uint32_t *serial) void zone_set_lastsigned_serial(zone_t *zone, uint32_t serial) { - zone->timers.last_signed_serial = serial; - zone->timers.last_signed_s_flags = LAST_SIGNED_SERIAL_FOUND | LAST_SIGNED_SERIAL_VALID; + zone->timers->last_signed_serial = serial; + zone->timers->last_signed_s_flags = LAST_SIGNED_SERIAL_FOUND | LAST_SIGNED_SERIAL_VALID; } int zone_get_lastsigned_serial(zone_t *zone, uint32_t *serial) { - if (!(zone->timers.last_signed_s_flags & LAST_SIGNED_SERIAL_FOUND)) { + if (!(zone->timers->last_signed_s_flags & LAST_SIGNED_SERIAL_FOUND)) { // backwards compatibility: it used to be stored in KASP DB, moved to timers for performance return kasp_db_load_serial(zone_kaspdb(zone), zone->name, KASPDB_SERIAL_LASTSIGNED, serial); } - if (!(zone->timers.last_signed_s_flags & LAST_SIGNED_SERIAL_VALID)) { + if (!(zone->timers->last_signed_s_flags & LAST_SIGNED_SERIAL_VALID)) { return KNOT_ENOENT; } - *serial = zone->timers.last_signed_serial; + *serial = zone->timers->last_signed_serial; return KNOT_EOK; } diff --git a/src/knot/zone/zone.h b/src/knot/zone/zone.h index 52088de85e..28788e2fc2 100644 --- a/src/knot/zone/zone.h +++ b/src/knot/zone/zone.h @@ -100,7 +100,7 @@ typedef struct zone } zonefile; /*! \brief Zone events. */ - zone_timers_t timers; //!< Persistent zone timers. + zone_timers_t *timers; //!< Persistent zone timers. zone_events_t events; //!< Zone events timers. /*! \brief Track unsuccessful NOTIFY targets. */ diff --git a/src/knot/zone/zonedb-load.c b/src/knot/zone/zonedb-load.c index f7135b0df3..933a2cb207 100644 --- a/src/knot/zone/zonedb-load.c +++ b/src/knot/zone/zonedb-load.c @@ -103,7 +103,7 @@ static zone_t *create_zone_reload(conf_t *conf, const knot_dname_t *name, zone->contents = old_zone->contents; zone_set_flag(zone, zone_get_flag(old_zone, ~0, false)); - zone->timers = old_zone->timers; + memcpy(zone->timers, old_zone->timers, sizeof(*zone->timers)); zone_timers_sanitize(conf, zone); if (old_zone->control_update != NULL) { @@ -128,7 +128,7 @@ static zone_t *create_zone_new(conf_t *conf, const knot_dname_t *name, return NULL; } - int ret = zone_timers_read(&server->timerdb, name, &zone->timers); + int ret = zone_timers_read(&server->timerdb, name, zone->timers); if (ret != KNOT_EOK && ret != KNOT_ENODB && ret != KNOT_ENOENT) { log_zone_error(zone->name, "failed to load persistent timers (%s)", knot_strerror(ret)); @@ -144,10 +144,10 @@ static zone_t *create_zone_new(conf_t *conf, const knot_dname_t *name, conf_val_t catz = conf_zone_get(conf, C_CATALOG_ZONE, name); assert(catz.code == KNOT_EOK); // conf consistency checked in conf/tools.c zone->catalog_gen = knot_dname_copy(conf_dname(&catz), NULL); - if (zone->timers.catalog_member == 0) { - zone->timers.catalog_member = time(NULL); + if (zone->timers->catalog_member == 0) { + zone->timers->catalog_member = time(NULL); ret = zone_timers_write(&zone->server->timerdb, zone->name, - &zone->timers); + zone->timers); } if (ret != KNOT_EOK || zone->catalog_gen == NULL) { log_zone_error(zone->name, "failed to initialize catalog member zone (%s)", @@ -226,8 +226,8 @@ static void zone_purge(conf_t *conf, zone_t *zone) static zone_contents_t *zone_expire(zone_t *zone, bool zonedb_cow) { if (!zonedb_cow) { - zone->timers.next_expire = time(NULL); - zone->timers.next_refresh = zone->timers.next_expire; + zone->timers->next_expire = time(NULL); + zone->timers->next_refresh = zone->timers->next_expire; } return zone_switch_contents(zone, NULL); }