From: Mark Andrews Date: Wed, 22 Jan 2025 09:58:33 +0000 (+1100) Subject: Set PENDINGOK if STARTATZONE is set X-Git-Tag: v9.21.5~10^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6469ebd08e1fd18ecb87be6d9ec7111d55d4c820;p=thirdparty%2Fbind9.git Set PENDINGOK if STARTATZONE is set When there are parent and child zones on the same server, the DNSKEY lookup was failing as the pending record we are validating is needed to fetch the DNSKEY records. This change allows that to happen. The caller is already setting STARTATZONE when the name being looked up is a subdomain of the current domain. --- diff --git a/lib/dns/adb.c b/lib/dns/adb.c index f4fa79166e1..8df847e26ff 100644 --- a/lib/dns/adb.c +++ b/lib/dns/adb.c @@ -2649,6 +2649,7 @@ dbfind_name(dns_adbname_t *adbname, isc_stdtime_t now, dns_rdatatype_t rdtype) { dns_adb_t *adb = NULL; dns_fixedname_t foundname; dns_name_t *fname = NULL; + unsigned int options = DNS_DBFIND_GLUEOK | DNS_DBFIND_ADDITIONALOK; REQUIRE(DNS_ADBNAME_VALID(adbname)); @@ -2674,11 +2675,13 @@ dbfind_name(dns_adbname_t *adbname, isc_stdtime_t now, dns_rdatatype_t rdtype) { * any matching static-stub zone without looking into the cache to honor * the configuration on which server we should send queries to. */ - result = - dns_view_find(adb->view, adbname->name, rdtype, now, - DNS_DBFIND_GLUEOK | DNS_DBFIND_ADDITIONALOK, true, - ((adbname->flags & DNS_ADBFIND_STARTATZONE) != 0), - NULL, NULL, fname, &rdataset, NULL); + if ((adbname->flags & DNS_ADBFIND_STARTATZONE) != 0) { + options |= DNS_DBFIND_PENDINGOK; + } + result = dns_view_find( + adb->view, adbname->name, rdtype, now, options, true, + ((adbname->flags & DNS_ADBFIND_STARTATZONE) != 0), NULL, NULL, + fname, &rdataset, NULL); switch (result) { case DNS_R_GLUE: