From: Libor Peltan Date: Fri, 11 Jun 2021 19:26:58 +0000 (+0200) Subject: update/load: use correct conf in event handler X-Git-Tag: v3.1.0~57^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c5e63c438bae1dc2f271fb0083335e50330c808c;p=thirdparty%2Fknot-dns.git update/load: use correct conf in event handler --- diff --git a/src/knot/events/handlers/load.c b/src/knot/events/handlers/load.c index 93130e5412..00492abd8b 100644 --- a/src/knot/events/handlers/load.c +++ b/src/knot/events/handlers/load.c @@ -194,7 +194,7 @@ int event_load(conf_t *conf, zone_t *zone) zu_from_zf_conts = true; } else { // compute ZF diff and if success, apply it - ret = zone_update_from_differences(&up, zone, NULL, zf_conts, UPDATE_INCREMENTAL, ignore_dnssec); + ret = zone_update_from_differences(&up, conf, zone, NULL, zf_conts, UPDATE_INCREMENTAL, ignore_dnssec); } } else { if (journal_conts != NULL && (zf_from != ZONEFILE_LOAD_WHOLE || zone->cat_members != NULL)) { @@ -203,7 +203,7 @@ int event_load(conf_t *conf, zone_t *zone) ret = zone_update_from_contents(&up, zone, journal_conts, UPDATE_HYBRID); } else { // load zone-in-journal, compute ZF diff and if success, apply it - ret = zone_update_from_differences(&up, zone, journal_conts, zf_conts, + ret = zone_update_from_differences(&up, conf, zone, journal_conts, zf_conts, UPDATE_HYBRID, ignore_dnssec); if (ret == KNOT_ESEMCHECK || ret == KNOT_ERANGE) { log_zone_warning(zone->name, @@ -258,7 +258,7 @@ int event_load(conf_t *conf, zone_t *zone) if (do_diff && old_contents_exist && dnssec_enable && zf_conts != NULL && zone_contents_serial(zf_conts) != zone_contents_serial(zone->contents) && !zone_in_journal_exists) { - ret = zone_update_start_extra(&up); + ret = zone_update_start_extra(&up, conf); if (ret != KNOT_EOK) { goto cleanup; } diff --git a/src/knot/updates/zone-update.c b/src/knot/updates/zone-update.c index e46ecd9ff5..d3c25fd5e7 100644 --- a/src/knot/updates/zone-update.c +++ b/src/knot/updates/zone-update.c @@ -161,7 +161,7 @@ int zone_update_init(zone_update_t *update, zone_t *zone, zone_update_flags_t fl return init_base(update, zone, NULL, flags); } -int zone_update_from_differences(zone_update_t *update, zone_t *zone, zone_contents_t *old_cont, +int zone_update_from_differences(zone_update_t *update, conf_t *conf, zone_t *zone, zone_contents_t *old_cont, zone_contents_t *new_cont, zone_update_flags_t flags, bool ignore_dnssec) { if (update == NULL || zone == NULL || new_cont == NULL || @@ -269,7 +269,7 @@ int zone_update_from_contents(zone_update_t *update, zone_t *zone_without_conten return KNOT_EOK; } -int zone_update_start_extra(zone_update_t *update) +int zone_update_start_extra(zone_update_t *update, conf_t *conf) { assert((update->flags & (UPDATE_INCREMENTAL | UPDATE_HYBRID))); @@ -279,7 +279,7 @@ int zone_update_start_extra(zone_update_t *update) } if (update->init_cont != NULL) { - ret = zone_update_increment_soa(update, conf()); + ret = zone_update_increment_soa(update, conf); if (ret != KNOT_EOK) { return ret; } @@ -294,7 +294,7 @@ int zone_update_start_extra(zone_update_t *update) return KNOT_ENOMEM; } - ret = zone_update_increment_soa(update, conf()); + ret = zone_update_increment_soa(update, conf); if (ret != KNOT_EOK) { return ret; } diff --git a/src/knot/updates/zone-update.h b/src/knot/updates/zone-update.h index 4aab30b6ea..1f18535345 100644 --- a/src/knot/updates/zone-update.h +++ b/src/knot/updates/zone-update.h @@ -78,6 +78,7 @@ int zone_update_init(zone_update_t *update, zone_t *zone, zone_update_flags_t fl * the diff is calculated, so that this update is INCREMENTAL. * * \param update Zone update structure to init. + * \param conf Configuration. * \param zone Init with this zone. * \param old_cont The current zone contents the diff will be against. Probably zone->contents. * \param new_cont New zone contents. Will be taken over (and later freed) by zone update. @@ -85,7 +86,7 @@ int zone_update_init(zone_update_t *update, zone_t *zone, zone_update_flags_t fl * * \return KNOT_E* */ -int zone_update_from_differences(zone_update_t *update, zone_t *zone, zone_contents_t *old_cont, +int zone_update_from_differences(zone_update_t *update, conf_t *conf, zone_t *zone, zone_contents_t *old_cont, zone_contents_t *new_cont, zone_update_flags_t flags, bool ignore_dnssec); /*! @@ -107,10 +108,11 @@ int zone_update_from_contents(zone_update_t *update, zone_t *zone_without_conten * This shall be used after from_differences, to start tracking changes that are against the loaded zonefile. * * \param update Zone update. + * \param conf Configuration. * * \return KNOT_E* */ -int zone_update_start_extra(zone_update_t *update); +int zone_update_start_extra(zone_update_t *update, conf_t *conf); /*! * \brief Returns node that would be in the zone after updating it.