]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix that qname minimisation does not skip a label when missing
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 8 Feb 2019 13:30:51 +0000 (13:30 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 8 Feb 2019 13:30:51 +0000 (13:30 +0000)
  nameserver targets need to be fetched.

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

doc/Changelog
iterator/iterator.c

index 2f06464f1931e1eb855711853e8f3495fb0ee477..ca54d29067f866363d5ee180879fc5bbfee4fccc 100644 (file)
@@ -1,5 +1,7 @@
 7 February 2019: Wouter
        - Fix #4206: OpenSSL 1.0.2 hostname verification for FreeBSD 11.2.
+       - Fix that qname minimisation does not skip a label when missing
+         nameserver targets need to be fetched.
 
 4 February 2019: Wouter
        - Fix that log-replies prints the correct name for local-alias
index 8312dfd53313f2fc3abe5fbe03b83e11186e3f9d..adc2b2233b4b8b44d0110e4d8e78310265950e10 100644 (file)
@@ -2105,6 +2105,8 @@ processQueryTargets(struct module_qstate* qstate, struct iter_qstate* iq,
        struct delegpt_addr* target;
        struct outbound_entry* outq;
        int auth_fallback = 0;
+       uint8_t* qout_orig = NULL;
+       size_t qout_orig_len = 0;
 
        /* NOTE: a request will encounter this state for each target it 
         * needs to send a query to. That is, at least one per referral, 
@@ -2178,6 +2180,8 @@ processQueryTargets(struct module_qstate* qstate, struct iter_qstate* iq,
                int labdiff = qchaselabs -
                        dname_count_labels(iq->qinfo_out.qname);
 
+               qout_orig = iq->qinfo_out.qname;
+               qout_orig_len = iq->qinfo_out.qname_len;
                iq->qinfo_out.qname = iq->qchase.qname;
                iq->qinfo_out.qname_len = iq->qchase.qname_len;
                iq->minimise_count++;
@@ -2330,6 +2334,13 @@ processQueryTargets(struct module_qstate* qstate, struct iter_qstate* iq,
                        /* wait to get all targets, we want to try em */
                        verbose(VERB_ALGO, "wait for all targets for fallback");
                        qstate->ext_state[id] = module_wait_reply;
+                       /* undo qname minimise step because we'll get back here
+                        * to do it again */
+                       if(qout_orig && iq->minimise_count > 0) {
+                               iq->minimise_count--;
+                               iq->qinfo_out.qname = qout_orig;
+                               iq->qinfo_out.qname_len = qout_orig_len;
+                       }
                        return 0;
                }
                /* did we do enough fallback queries already? */
@@ -2463,6 +2474,13 @@ processQueryTargets(struct module_qstate* qstate, struct iter_qstate* iq,
                                iq->num_current_queries);
                        qstate->ext_state[id] = module_wait_reply;
                }
+               /* undo qname minimise step because we'll get back here
+                * to do it again */
+               if(qout_orig && iq->minimise_count > 0) {
+                       iq->minimise_count--;
+                       iq->qinfo_out.qname = qout_orig;
+                       iq->qinfo_out.qname_len = qout_orig_len;
+               }
                return 0;
        }