]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Don't process DNSSEC-related and ZONEMD records in catz
authorAram Sargsyan <aram@isc.org>
Wed, 1 Jun 2022 08:51:55 +0000 (08:51 +0000)
committerAram Sargsyan <aram@isc.org>
Thu, 2 Jun 2022 08:42:25 +0000 (08:42 +0000)
When processing a catalog zone update, skip processing records with
DNSSEC-related and ZONEMD types, because we are not interested in them
in the context of a catalog zone, and processing them will fail and
produce an unnecessary warning message.

lib/dns/catz.c

index 6007a1cab1de0423817b0a105365e224a4681824..c926be424c77f03bdc3fa319efabcb1f7aa2e6ed 100644 (file)
@@ -2088,6 +2088,12 @@ cleanup:
        return (result);
 }
 
+static bool
+catz_rdatatype_is_processable(const dns_rdatatype_t type) {
+       return (!dns_rdatatype_isdnssec(type) && type != dns_rdatatype_cds &&
+               type != dns_rdatatype_cdnskey && type != dns_rdatatype_zonemd);
+}
+
 void
 dns_catz_update_from_db(dns_db_t *db, dns_catz_zones_t *catzs) {
        dns_catz_zone_t *oldzone = NULL, *newzone = NULL;
@@ -2230,6 +2236,17 @@ dns_catz_update_from_db(dns_db_t *db, dns_catz_zones_t *catzs) {
                result = dns_rdatasetiter_first(rdsiter);
                while (result == ISC_R_SUCCESS) {
                        dns_rdatasetiter_current(rdsiter, &rdataset);
+
+                       /*
+                        * Skip processing DNSSEC-related and ZONEMD types,
+                        * because we are not interested in them in the context
+                        * of a catalog zone, and processing them will fail
+                        * and produce an unnecessary warning message.
+                        */
+                       if (!catz_rdatatype_is_processable(rdataset.type)) {
+                               goto next;
+                       }
+
                        result = dns_catz_update_process(catzs, newzone, name,
                                                         &rdataset);
                        if (result != ISC_R_SUCCESS) {
@@ -2251,6 +2268,7 @@ dns_catz_update_from_db(dns_db_t *db, dns_catz_zones_t *catzs) {
                                              cname, classbuf, typebuf,
                                              isc_result_totext(result));
                        }
+               next:
                        dns_rdataset_disassociate(&rdataset);
                        result = dns_rdatasetiter_next(rdsiter);
                }