]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Set PENDINGOK if STARTATZONE is set
authorMark Andrews <marka@isc.org>
Wed, 22 Jan 2025 09:58:33 +0000 (20:58 +1100)
committerMark Andrews <marka@isc.org>
Mon, 3 Feb 2025 00:24:34 +0000 (00:24 +0000)
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.

lib/dns/adb.c

index f4fa79166e12b3a30c830af7c71165c3818fd09c..8df847e26ff8270971445342d54af4fc65315a69 100644 (file)
@@ -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: