Add new dns_rdatatype_iskeymaterial() function

The following code block repeats quite often:

    if (rdata.type == dns_rdatatype_dnskey ||
        rdata.type == dns_rdatatype_cdnskey ||
        rdata.type == dns_rdatatype_cds)

Introduce a new function to reduce the repetition.

(cherry picked from commit ef58f2444f)
This commit is contained in:
Matthijs Mekking
2023-03-15 11:51:33 +01:00
committed by Mark Andrews
parent 74109dfea6
commit 0d36d98791
6 changed files with 46 additions and 36 deletions

View File

@@ -3390,6 +3390,29 @@ update_action(isc_task_t *task, isc_event_t *event) {
continue;
}
}
#if 0
/*
* Don't remove DNSKEY, CDNSKEY, CDS records
* that are in use (under our control).
*/
if (dns_rdatatype_iskeymaterial(rdata.type)) {
isc_result_t r;
bool inuse = false;
r = dns_zone_dnskey_inuse(zone, &rdata,
&inuse);
if (r != ISC_R_SUCCESS) {
FAIL(r);
}
if (inuse) {
update_log(client, zone,
LOGLEVEL_PROTOCOL,
"attempt to "
"delete in use "
"DNSKEY ignored");
continue;
}
}
#endif
}
dns_name_format(name, namestr, sizeof(namestr));
dns_rdatatype_format(rdata.type, typestr,