]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- When retry to parent the retrycount is not wiped, so failed
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 11 Jun 2010 14:09:56 +0000 (14:09 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 11 Jun 2010 14:09:56 +0000 (14:09 +0000)
         nameservers are not tried again.
       - iana portlist updated.

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

doc/Changelog
iterator/iter_utils.c
iterator/iter_utils.h
iterator/iterator.c
util/iana_ports.inc

index e29eff2f41759465fc873c2b40bc130fa713409d..90c8df01d15b2ceb5e60dbcf532d8ef7ab97d8a0 100644 (file)
@@ -1,3 +1,8 @@
+11 June 2010: Wouter
+       - When retry to parent the retrycount is not wiped, so failed 
+         nameservers are not tried again.
+       - iana portlist updated.
+
 10 June 2010: Wouter
        - Fix bug where a long loop could be entered, now cycle detection
          has a loop-counter and maximum search amount.
index 7b946b88e3e27c2ac1b2c809bf32c62498c7e5e7..d33db3f539d1fff13f1b61af2eefe78cec36bb85 100644 (file)
@@ -933,3 +933,31 @@ void iter_dec_attempts(struct delegpt* dp, int d)
                else a->attempts = 0;
        }
 }
+
+void iter_merge_retry_counts(struct delegpt* dp, struct delegpt* old)
+{
+       struct delegpt_addr* a, *o, *prev;
+       for(a=dp->target_list; a; a = a->next_target) {
+               o = delegpt_find_addr(old, &a->addr, a->addrlen);
+               if(o) {
+                       log_addr(VERB_ALGO, "copy attempt count previous dp",
+                               &a->addr, a->addrlen);
+                       a->attempts = o->attempts;
+               }
+       }
+       prev = NULL;
+       a = dp->result_list;
+       while(a) {
+               if(a->attempts >= OUTBOUND_MSG_RETRY) {
+                       /* remove from result list */
+                       if(prev)
+                               prev->next_result = a->next_result;
+                       else    dp->result_list = a->next_result;
+                       /* prev stays the same */
+                       a = a->next_result;
+                       continue;
+               }
+               prev = a;
+               a = a->next_result;
+       }
+}
index e8c5d04f24da5a35a9a26c6b99245e158e0885a8..58ba5a9202c296b121a24331af788e8653002447 100644 (file)
@@ -298,4 +298,12 @@ void iter_scrub_ds(struct dns_msg* msg, struct ub_packed_rrset_key* ns,
  */
 void iter_dec_attempts(struct delegpt* dp, int d);
 
+/**
+ * Add retry counts from older delegpt to newer delegpt.
+ * Does not waste time on timeout'd (or other failing) addresses.
+ * @param dp: new delegationpoint.
+ * @param old: old delegationpoint.
+ */
+void iter_merge_retry_counts(struct delegpt* dp, struct delegpt* old);
+
 #endif /* ITERATOR_ITER_UTILS_H */
index f28891a9e6aeef284d8b822075e27dfdbdcd163d..10c078803e29cf7bce124cad5ab039f130a4ce16 100644 (file)
@@ -1807,6 +1807,7 @@ processQueryResponse(struct module_qstate* qstate, struct iter_qstate* iq,
                                qstate->region);
                return final_state(iq);
        } else if(type == RESPONSE_TYPE_REFERRAL) {
+               struct delegpt* old_dp = iq->dp;
                /* REFERRAL type responses get a reset of the 
                 * delegation point, and back to the QUERYTARGETS_STATE. */
                verbose(VERB_DETAIL, "query response was REFERRAL");
@@ -1863,6 +1864,9 @@ processQueryResponse(struct module_qstate* qstate, struct iter_qstate* iq,
                if(!cache_fill_missing(qstate->env, iq->qchase.qclass, 
                        qstate->region, iq->dp))
                        return error_response(qstate, id, LDNS_RCODE_SERVFAIL);
+               if(iq->store_parent_NS && query_dname_compare(iq->dp->name,
+                       old_dp->name) == 0)
+                       iter_merge_retry_counts(iq->dp, old_dp);
                delegpt_log(VERB_ALGO, iq->dp);
                /* Count this as a referral. */
                iq->referral_count++;
index f7b9e847d87895f539e5fd35079f3968864f81c9..6ca78799684bae13118737becf8a51d9558bbe47 100644 (file)
 5679,
 5680,
 5681,
+5682,
 5688,
 5689,
 5713,