diff --git a/src/libknot/updates/xfr-in.c b/src/libknot/updates/xfr-in.c index 975f702f2138b639777e3d8b82b75b811f4542fa..6eee7c8bbbc9e37c85dbf33ced12fb186f88f378 100644 --- a/src/libknot/updates/xfr-in.c +++ b/src/libknot/updates/xfr-in.c @@ -2000,6 +2000,16 @@ dbg_xfrin_exec_detail( dbg_xfrin_detail("RDATA in RRSet1: %p, RDATA in RRSet2: %p\n", (*rrset)->rdata, add->rdata); + /* In case the RRSet is empty (and only remained there because of the + * RRSIGs, it may happen that the TTL may be different than that of + * the new RRs. Update the TTL according to the first RR. + */ + + if (knot_rrset_rdata(*rrset) == NULL + && knot_rrset_ttl(*rrset) != knot_rrset_ttl(add)) { + knot_rrset_set_ttl(*rrset, knot_rrset_ttl(add)); + } + ret = knot_rrset_merge((void **)rrset, (void **)&add); if (ret != KNOT_EOK) { dbg_xfrin("Failed to merge changeset RRSet.\n");