]> git.pld-linux.org Git - packages/unbound.git/blob - unbound-bug-3512.patch
- rel 2; fix CAA queries on CNAME loops
[packages/unbound.git] / unbound-bug-3512.patch
1 diff --git a/iterator/iterator.c b/iterator/iterator.c
2 index 7f3c6573..26660059 100644
3 --- a/iterator/iterator.c
4 +++ b/iterator/iterator.c
5 @@ -1157,6 +1157,13 @@ processInitRequest(struct module_qstate* qstate, struct iter_qstate* iq,
6         if(iq->query_restart_count > MAX_RESTART_COUNT) {
7                 verbose(VERB_QUERY, "request has exceeded the maximum number"
8                         " of query restarts with %d", iq->query_restart_count);
9 +               if(iq->response) {
10 +                       /* return the partial CNAME loop, i.e. with the
11 +                        * actual packet in iq->response cleared of RRsets,
12 +                        * the stored prepend RRsets contain the loop contents
13 +                        * with duplicates removed */
14 +                       return next_state(iq, FINISHED_STATE);
15 +               }
16                 return error_response(qstate, id, LDNS_RCODE_SERVFAIL);
17         }
18  
19 @@ -1246,6 +1253,10 @@ processInitRequest(struct module_qstate* qstate, struct iter_qstate* iq,
20                         iq->qchase.qname_len = slen;
21                         /* This *is* a query restart, even if it is a cheap 
22                          * one. */
23 +                       msg->rep->an_numrrsets = 0;
24 +                       msg->rep->ns_numrrsets = 0;
25 +                       msg->rep->ar_numrrsets = 0;
26 +                       msg->rep->rrset_count = 0;
27                         iq->dp = NULL;
28                         iq->refetch_glue = 0;
29                         iq->query_restart_count++;
30 @@ -2739,6 +2750,10 @@ processQueryResponse(struct module_qstate* qstate, struct iter_qstate* iq,
31                 if (qstate->env->cfg->qname_minimisation)
32                         iq->minimisation_state = INIT_MINIMISE_STATE;
33                 /* Clear the query state, since this is a query restart. */
34 +               iq->response->rep->an_numrrsets = 0;
35 +               iq->response->rep->ns_numrrsets = 0;
36 +               iq->response->rep->ar_numrrsets = 0;
37 +               iq->response->rep->rrset_count = 0;
38                 iq->deleg_msg = NULL;
39                 iq->dp = NULL;
40                 iq->dsns_point = NULL;
This page took 0.025189 seconds and 3 git commands to generate.