]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix queries being leaked above stub when refetching glue.
authorRalph Dolmans <ralph@nlnetlabs.nl>
Wed, 3 Jan 2018 16:54:22 +0000 (16:54 +0000)
committerRalph Dolmans <ralph@nlnetlabs.nl>
Wed, 3 Jan 2018 16:54:22 +0000 (16:54 +0000)
git-svn-id: file:///svn/unbound/trunk@4434 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
iterator/iterator.c

index 16f3cacdb13e445c2038d24f38f1b98a6c0ab7ee..2fc0238344cce7bfdd3f1fbd2f8680e268afcae1 100644 (file)
@@ -1,3 +1,6 @@
+3 January 2018: Ralph
+       - Fix queries being leaked above stub when refetching glue.
+
 2 January 2017: Wouter
        - Fix that DS queries with referral replies are answered straight
          away, without a repeat query picking the DS from cache.
index d67d8eb3683020e5345ad23a43ae834128a914c4..c6e09be30f1cea6e6541a1063d7aa4d576e32e9d 100644 (file)
@@ -1374,16 +1374,23 @@ processInitRequest2(struct module_qstate* qstate, struct iter_qstate* iq,
        log_query_info(VERB_QUERY, "resolving (init part 2): ", 
                &qstate->qinfo);
 
+       delname = iq->qchase.qname;
+       delnamelen = iq->qchase.qname_len;
        if(iq->refetch_glue) {
                if(!iq->dp) {
                        log_err("internal or malloc fail: no dp for refetch");
                        return error_response(qstate, id, LDNS_RCODE_SERVFAIL);
                }
-               delname = iq->dp->name;
-               delnamelen = iq->dp->namelen;
-       } else {
-               delname = iq->qchase.qname;
-               delnamelen = iq->qchase.qname_len;
+               /* Do not send queries above stub, do not set delname to dp if
+                * this is above stub without stub-first. */
+               struct iter_hints_stub* stub = hints_lookup_stub(
+                       qstate->env->hints, iq->qchase.qname, iq->qchase.qclass,
+                       iq->dp);
+               if(!stub || !stub->dp->has_parent_side_NS || 
+                       dname_subdomain_c(iq->dp->name, stub->dp->name)) {
+                       delname = iq->dp->name;
+                       delnamelen = iq->dp->namelen;
+               }
        }
        if(iq->qchase.qtype == LDNS_RR_TYPE_DS || iq->refetch_glue) {
                if(!dname_is_root(delname))