]> git.ipfire.org Git - thirdparty/knot-dns.git/commitdiff
update/load: use correct conf in event handler
authorLibor Peltan <libor.peltan@nic.cz>
Fri, 11 Jun 2021 19:26:58 +0000 (21:26 +0200)
committerDaniel Salzman <daniel.salzman@nic.cz>
Wed, 23 Jun 2021 09:38:49 +0000 (11:38 +0200)
src/knot/events/handlers/load.c
src/knot/updates/zone-update.c
src/knot/updates/zone-update.h

index 93130e54120aaee00319915ebc52d1daac58999f..00492abd8b9c0047d18f7e2ccf10135af11273c7 100644 (file)
@@ -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;
                }
index e46ecd9ff5437434e3e20fa56d7beaed6ec49367..d3c25fd5e734a3cbfef4b005b8098e3f7fb7b3fe 100644 (file)
@@ -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;
                }
index 4aab30b6eaea91662133681fbebc27377d0c0ffc..1f185353459378fe5986b95cd1b201d27443544b 100644 (file)
@@ -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.