]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- many nameservers does not try to compare more than max-sent-count,
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Wed, 4 Mar 2015 09:06:05 +0000 (09:06 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Wed, 4 Mar 2015 09:06:05 +0000 (09:06 +0000)
  parse failures start 0x20 fallback procedure.

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

doc/Changelog
iterator/iterator.c

index a3b05b49a47929b7e3a01215c8b6b5475db44c58..e709e8fb37b17611c8648a3a36c2b5804e33e6e7 100644 (file)
@@ -1,10 +1,11 @@
 4 March 2015: Wouter
        - Patch from Brad Smith that syncs compat/getentropy_linux with
          OpenBSD's version (2015-03-04).
-       - 0x20 fallback improved, better handling of servfail responses,
-         they do not count as missing comparisons (except if all are failed),
-         and better handling of inability to find nameservers, no more
-         nameservers can be found results in fallback acceptance.
+       - 0x20 fallback improved: servfail responses do not count as missing
+         comparisons (except if all responses are errors),
+         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.
 
 3 March 2015: Wouter
        - tag 1.5.3rc1
index cd7e5b36b1f34361863f2212927312d0a4f01920..9c425fc11aef270f78f16166b88d54a3af4b1736 100644 (file)
@@ -1787,7 +1787,8 @@ processQueryTargets(struct module_qstate* qstate, struct iter_qstate* iq,
                 * the original query is one that matched too, so we have
                 * caps_server+1 number of matching queries now */
                if(iq->caps_server+1 >= naddr*3 ||
-                       iq->caps_server+1 >= MAX_SENT_COUNT) {
+                       iq->caps_server*2+2 >= MAX_SENT_COUNT) {
+                       /* *2 on sentcount check because ipv6 may fail */
                        /* we're done, process the response */
                        verbose(VERB_ALGO, "0x20 fallback had %d responses "
                                "match for %d wanted, done.", 
@@ -2884,8 +2885,18 @@ process_response(struct module_qstate* qstate, struct iter_qstate* iq,
 
        /* normalize and sanitize: easy to delete items from linked lists */
        if(!scrub_message(pkt, prs, &iq->qchase, iq->dp->name, 
-               qstate->env->scratch, qstate->env, ie))
+               qstate->env->scratch, qstate->env, ie)) {
+               /* if 0x20 enabled, start fallback, but we have no message */
+               if(event == module_event_capsfail && !iq->caps_fallback) {
+                       iq->caps_fallback = 1;
+                       iq->caps_server = 0;
+                       iq->caps_reply = NULL;
+                       iq->state = QUERYTARGETS_STATE;
+                       iq->num_current_queries--;
+                       verbose(VERB_DETAIL, "Capsforid: scrub failed, starting fallback with no response");
+               }
                goto handle_it;
+       }
 
        /* allocate response dns_msg in region */
        iq->response = dns_alloc_msg(pkt, prs, qstate->region);