summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Salzman <daniel.salzman@nic.cz>2024-12-20 14:24:19 +0100
committerDaniel Salzman <daniel.salzman@nic.cz>2024-12-20 14:24:19 +0100
commit8c1c9d948ece74c8e5eeb8cdd0056b29f36db13e (patch)
tree7d09ae2602d15007e7e794c38fd203d9cc667e4d
parentstats: fix duplicate XDP counter names in YAML dump (diff)
parentRRSIGs/TTL: set rrsig->ttl to zero... (diff)
downloadknot-8c1c9d948ece74c8e5eeb8cdd0056b29f36db13e.tar.xz
knot-8c1c9d948ece74c8e5eeb8cdd0056b29f36db13e.zip
Merge branch 'max_ttl_rrsig_bck' into 'master'
RRSIGs/TTL: set rrsig->ttl to zero... See merge request knot/knot-dns!1734
-rw-r--r--src/knot/journal/serialization.c2
-rw-r--r--src/knot/zone/node.c11
2 files changed, 8 insertions, 5 deletions
diff --git a/src/knot/journal/serialization.c b/src/knot/journal/serialization.c
index 65277cca9..584fb5116 100644
--- a/src/knot/journal/serialization.c
+++ b/src/knot/journal/serialization.c
@@ -146,7 +146,7 @@ skip_next_nsec3:
}
if (ctx->zone_diff) {
knot_rrset_t counter_rr = node_rrset(binode_counterpart(ctx->n), res.type);
- if (counter_rr.ttl == res.ttl && !knot_rrset_empty(&counter_rr)) {
+ if ((counter_rr.ttl == res.ttl || res.type == KNOT_RRTYPE_RRSIG) && !knot_rrset_empty(&counter_rr)) {
if (knot_rdataset_subset(&res.rrs, &counter_rr.rrs)) {
goto skip_next_nsec3;
}
diff --git a/src/knot/zone/node.c b/src/knot/zone/node.c
index 82d930d8f..0a29cc148 100644
--- a/src/knot/zone/node.c
+++ b/src/knot/zone/node.c
@@ -42,6 +42,11 @@ bool additional_equal(additional_t *a, additional_t *b)
return true;
}
+static uint32_t rr_insert_ttl(const knot_rrset_t *rr)
+{
+ return rr->type == KNOT_RRTYPE_RRSIG ? 0 : rr->ttl;
+}
+
/*! \brief Clears allocated data in RRSet entry. */
static void rr_data_clear(struct rr_data *data, knot_mm_t *mm)
{
@@ -56,7 +61,7 @@ static int rr_data_from(const knot_rrset_t *rrset, struct rr_data *data, knot_mm
if (ret != KNOT_EOK) {
return ret;
}
- data->ttl = rrset->ttl;
+ data->ttl = rr_insert_ttl(rrset);
data->type = rrset->type;
data->additional = NULL;
@@ -321,9 +326,7 @@ int node_add_rrset(zone_node_t *node, const knot_rrset_t *rrset, knot_mm_t *mm)
if (node->rrs[i].type == rrset->type) {
struct rr_data *node_data = &node->rrs[i];
const bool ttl_change = ttl_changed(node_data, rrset);
- if (ttl_change) {
- node_data->ttl = rrset->ttl;
- }
+ node_data->ttl = rr_insert_ttl(rrset);
int ret = knot_rdataset_merge(&node_data->rrs,
&rrset->rrs, mm);