]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix missing RRSIG for CNAME with different slabheader order
authorOndřej Surý <ondrej@isc.org>
Tue, 6 Feb 2024 13:05:08 +0000 (14:05 +0100)
committerOndřej Surý <ondrej@isc.org>
Thu, 8 Feb 2024 07:02:48 +0000 (08:02 +0100)
The cachedb was missing piece of code (already found in zonedb) that
would make lookups in the slabheaders to miss the RRSIGs for CNAME if
the order of CNAME and RRSIG(CNAME) was reversed in the node->data.

lib/dns/rbt-cachedb.c

index ea2ff089969ce35e8cd07a073ca363c4f5cf5300..f4f3d25be6a8b32ba76bd4237eaed2a116b18b97 100644 (file)
@@ -909,13 +909,18 @@ cache_find(dns_db_t *db, const dns_name_t *name, dns_dbversion_t *version,
                                 */
                                found = header;
                                if (header->type == dns_rdatatype_cname &&
-                                   cname_ok && cnamesig != NULL)
+                                   cname_ok)
                                {
                                        /*
                                         * If we've already got the
                                         * CNAME RRSIG, use it.
                                         */
-                                       foundsig = cnamesig;
+                                       if (cnamesig != NULL) {
+                                               foundsig = cnamesig;
+                                       } else {
+                                               sigtype =
+                                                       RBTDB_RDATATYPE_SIGCNAME;
+                                       }
                                }
                        } else if (header->type == sigtype) {
                                /*