From 93bcd26bfaae4adf18b24afa0b04765dfe0ff376 Mon Sep 17 00:00:00 2001 From: Andreas Gustafsson Date: Thu, 9 Sep 1999 08:26:17 +0000 Subject: [PATCH] SIGs covering different types are now considered separate rdatasets in dns_diff_apply() --- lib/dns/journal.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/lib/dns/journal.c b/lib/dns/journal.c index e5269e2f96..3469560c3c 100644 --- a/lib/dns/journal.c +++ b/lib/dns/journal.c @@ -80,6 +80,12 @@ encode_uint32(isc_uint32_t val, unsigned char *p) { p[3] = val >> 0; } +static dns_rdatatype_t +rdata_covers(dns_rdata_t *rdata) { + return (rdata->type == dns_rdatatype_sig ? + dns_rdata_covers(rdata) : 0); +} + isc_uint32_t dns_soa_getserial(dns_rdata_t *rdata) { @@ -360,13 +366,14 @@ dns_diff_apply(dns_diff_t *diff, dns_db_t *db, dns_dbversion_t *ver) CHECK(dns_db_findnode(db, name, ISC_TRUE, &node)); while (t != NULL && dns_name_equal(&t->name, name)) { - dns_rdatatype_t type; + dns_rdatatype_t type, covers; dns_diffop_t op; dns_rdatalist_t rdl; dns_rdataset_t rds; op = t->op; type = t->rdata.type; + covers = rdata_covers(&t->rdata); /* * Collect a contiguous set of updates with @@ -383,15 +390,18 @@ dns_diff_apply(dns_diff_t *diff, dns_db_t *db, dns_dbversion_t *ver) * of the diff itself is not affected. */ - rdl.type = t->rdata.type; - rdl.covers = 0; /* XXX */ + rdl.type = type; + rdl.covers = covers; rdl.rdclass = t->rdata.rdclass; rdl.ttl = t->ttl; ISC_LIST_INIT(rdl.rdata); ISC_LINK_INIT(&rdl, link); - while (t != NULL && dns_name_equal(&t->name, name) && - t->op == op && t->rdata.type == type) + while (t != NULL && + dns_name_equal(&t->name, name) && + t->op == op && + t->rdata.type == type && + rdata_covers(&t->rdata) == covers) { if (t->ttl != rdl.ttl) { printf("TTL differs in rdataset, "