]> git.ipfire.org Git - thirdparty/knot-dns.git/commitdiff
update: incremental without NO_CHSET standalone SOA removal ignored...
authorLibor Peltan <libor.peltan@nic.cz>
Mon, 13 Oct 2025 14:29:23 +0000 (16:29 +0200)
committerLibor Peltan <libor.peltan@nic.cz>
Mon, 13 Oct 2025 14:29:23 +0000 (16:29 +0200)
otherwise for example knotc zone-begin followed by zone-diff shows SOA removal,
which respects the internals but makes no sense

src/knot/updates/zone-update.c

index 82574d197bd0218e237febbfa2337601cd9b9ea8..737ca5e2cd5b48904475bb96b533d216adf25e76 100644 (file)
@@ -1331,7 +1331,7 @@ int zone_update_foreach(zone_update_t *update, bool additions, rrset_cb_t cb, vo
        } else if (update->flags & (UPDATE_INCREMENTAL | UPDATE_HYBRID)) {
                knot_rrset_t *soa = additions ? update->change.soa_to : update->change.soa_from;
                zone_contents_t *c = additions ? update->change.add : update->change.remove;
-               int ret = (soa == NULL) ? KNOT_EOK : cb(soa, ctx);
+               int ret = (soa == NULL || update->change.soa_to == NULL) ? KNOT_EOK : cb(soa, ctx);
                if (ret == KNOT_EOK) {
                        ret = trees_foreach(c->nodes, c->nsec3_nodes, false, cb, ctx);
                }