]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Handle CNAME and DNAME in resume_min in a special way
authorPetr Mensik <pemensik@redhat.com>
Tue, 3 Jun 2025 19:00:58 +0000 (21:00 +0200)
committerMark Andrews <marka@isc.org>
Wed, 9 Jul 2025 00:13:29 +0000 (10:13 +1000)
When authoritative zone is loaded when query minimization query for the
same zone is already pending, it might receive unexpected result codes.

Normally DNS_R_CNAME would follow to query_cname after processing sent
events, but dns_view_findzonecut does not fill CNAME target into
event->foundevent. Usual lookup via query_lookup would always have that
filled.

Ideally we would restart the query with unmodified search name, if
unexpected change from recursing to local zone cut were detected. Until
dns_view_findzonecut is modified to export zone/cache source of the cut,
at least fail queries which went into unexpected state.

lib/dns/resolver.c

index 749754a2743e7e010e23c912881e3cdf139432d4..8601bcf67d001b053574bdae232e168a5369e3a8 100644 (file)
@@ -4284,8 +4284,14 @@ resume_qmin(void *arg) {
         * DNS_R_NXDOMAIN here means we have not loaded the root zone
         * mirror yet - but DNS_R_NXDOMAIN is not a valid return value
         * when doing recursion, we need to patch it.
+        *
+        * CNAME or DNAME means zone were added with that record
+        * after the start of a recursion. It means we do not have
+        * initialized correct hevent->foundname and have to fail.
         */
-       if (result == DNS_R_NXDOMAIN) {
+       if (result == DNS_R_NXDOMAIN || result == DNS_R_CNAME ||
+           result == DNS_R_DNAME)
+       {
                result = DNS_R_SERVFAIL;
        }