From d228dc63c1f168d5250ad88d6ae4cdc0e2b85ad9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Tue, 6 Feb 2024 14:05:08 +0100 Subject: [PATCH] Fix missing RRSIG for CNAME with different slabheader order 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. (cherry picked from commit 5070c7f5c74a143f74775515d65fad01f398ecd1) --- lib/dns/rbtdb.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/dns/rbtdb.c b/lib/dns/rbtdb.c index 7793be859e..13b8574104 100644 --- a/lib/dns/rbtdb.c +++ b/lib/dns/rbtdb.c @@ -5086,13 +5086,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) { /*