]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- store caps_response with best response in case downgrade response
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Wed, 4 Mar 2015 09:31:26 +0000 (09:31 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Wed, 4 Mar 2015 09:31:26 +0000 (09:31 +0000)
  happens to be the last one.

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

doc/Changelog
iterator/iterator.c
iterator/iterator.h

index e709e8fb37b17611c8648a3a36c2b5804e33e6e7..27eed04d265c97ed6f635ab7329ae4139bfcc56d 100644 (file)
@@ -6,6 +6,8 @@
          inability to find nameservers does not fail equality comparisons,
          many nameservers does not try to compare more than max-sent-count,
          parse failures start 0x20 fallback procedure.
+       - store caps_response with best response in case downgrade response
+         happens to be the last one.
 
 3 March 2015: Wouter
        - tag 1.5.3rc1
index 9c425fc11aef270f78f16166b88d54a3af4b1736..1853cd57f412724c4e7457cc4ee6508b03297ee5 100644 (file)
@@ -1876,6 +1876,7 @@ processQueryTargets(struct module_qstate* qstate, struct iter_qstate* iq,
                                                "but no more servers except "
                                                "last resort, done.", 
                                                (int)iq->caps_server+1);
+                                       iq->response = iq->caps_response;
                                        iq->caps_fallback = 0;
                                        iter_dec_attempts(iq->dp, 3); /* space for fallback */
                                        iq->num_current_queries++; /* RespState decrements it*/
@@ -2843,6 +2844,7 @@ process_response(struct module_qstate* qstate, struct iter_qstate* iq,
                        iq->caps_fallback = 1;
                        iq->caps_server = 0;
                        iq->caps_reply = NULL;
+                       iq->caps_response = NULL;
                        iq->state = QUERYTARGETS_STATE;
                        iq->num_current_queries--;
                        /* need fresh attempts for the 0x20 fallback, if
@@ -2891,6 +2893,7 @@ process_response(struct module_qstate* qstate, struct iter_qstate* iq,
                        iq->caps_fallback = 1;
                        iq->caps_server = 0;
                        iq->caps_reply = NULL;
+                       iq->caps_response = NULL;
                        iq->state = QUERYTARGETS_STATE;
                        iq->num_current_queries--;
                        verbose(VERB_DETAIL, "Capsforid: scrub failed, starting fallback with no response");
@@ -2918,6 +2921,7 @@ process_response(struct module_qstate* qstate, struct iter_qstate* iq,
                        iq->caps_fallback = 1;
                        iq->caps_server = 0;
                        iq->caps_reply = iq->response->rep;
+                       iq->caps_response = iq->response;
                        iq->state = QUERYTARGETS_STATE;
                        iq->num_current_queries--;
                        verbose(VERB_DETAIL, "Capsforid: starting fallback");
@@ -2926,12 +2930,14 @@ process_response(struct module_qstate* qstate, struct iter_qstate* iq,
                        /* check if reply is the same, otherwise, fail */
                        if(!iq->caps_reply) {
                                iq->caps_reply = iq->response->rep;
+                               iq->caps_response = iq->response;
                                iq->caps_server = -1; /*become zero at ++,
                                so that we start the full set of trials */
                        } else if(caps_failed_rcode(iq->caps_reply) &&
                                !caps_failed_rcode(iq->response->rep)) {
                                /* prefer to upgrade to non-SERVFAIL */
                                iq->caps_reply = iq->response->rep;
+                               iq->caps_response = iq->response;
                        } else if(!caps_failed_rcode(iq->caps_reply) &&
                                caps_failed_rcode(iq->response->rep)) {
                                /* if we have non-SERVFAIL as answer then 
index 1364b86d722b37cee9e277cf083400e7bead38e4..cb8043fd56b8385d82264f04fcfaf113cfac4848 100644 (file)
@@ -235,6 +235,7 @@ struct iter_qstate {
        /** state for capsfail: stored query for comparisons. Can be NULL if
         * no response had been seen prior to starting the fallback. */
        struct reply_info* caps_reply;
+       struct dns_msg* caps_response;
 
        /** Current delegation message - returned for non-RD queries */
        struct dns_msg* deleg_msg;