]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix #3512: unbound incorrectly reports SERVFAIL for CAA query
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Wed, 21 Feb 2018 13:13:58 +0000 (13:13 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Wed, 21 Feb 2018 13:13:58 +0000 (13:13 +0000)
  when there is a CNAME loop.

git-svn-id: file:///svn/unbound/trunk@4544 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
iterator/iterator.c

index 92ecbd17ca84c2f97d2166fa1df65f8a5f528c62..687c8b48e9c7c89fc479a37bdc209ef9338d23dc 100644 (file)
@@ -1,3 +1,7 @@
+21 February 2018: Wouter
+       - Fix #3512: unbound incorrectly reports SERVFAIL for CAA query
+         when there is a CNAME loop.
+
 19 February 2018: Wouter
        - Fix #3505: Documentation for default local zones references
          wrong RFC.
index 7f3c65737d5951848b02a3a606c978aa181ce581..1501fa00db50e76876e1b9f3adb18f73c424cccb 100644 (file)
@@ -1157,6 +1157,10 @@ processInitRequest(struct module_qstate* qstate, struct iter_qstate* iq,
        if(iq->query_restart_count > MAX_RESTART_COUNT) {
                verbose(VERB_QUERY, "request has exceeded the maximum number"
                        " of query restarts with %d", iq->query_restart_count);
+               if(iq->response) {
+                       iq->state = FINISHED_STATE;
+                       return 1;
+               }
                return error_response(qstate, id, LDNS_RCODE_SERVFAIL);
        }
 
@@ -1246,6 +1250,10 @@ processInitRequest(struct module_qstate* qstate, struct iter_qstate* iq,
                        iq->qchase.qname_len = slen;
                        /* This *is* a query restart, even if it is a cheap 
                         * one. */
+                       msg->rep->an_numrrsets = 0;
+                       msg->rep->ns_numrrsets = 0;
+                       msg->rep->ar_numrrsets = 0;
+                       msg->rep->rrset_count = 0;
                        iq->dp = NULL;
                        iq->refetch_glue = 0;
                        iq->query_restart_count++;
@@ -2739,6 +2747,10 @@ processQueryResponse(struct module_qstate* qstate, struct iter_qstate* iq,
                if (qstate->env->cfg->qname_minimisation)
                        iq->minimisation_state = INIT_MINIMISE_STATE;
                /* Clear the query state, since this is a query restart. */
+               iq->response->rep->an_numrrsets = 0;
+               iq->response->rep->ns_numrrsets = 0;
+               iq->response->rep->ar_numrrsets = 0;
+               iq->response->rep->rrset_count = 0;
                iq->deleg_msg = NULL;
                iq->dp = NULL;
                iq->dsns_point = NULL;