]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
Refetch glue code.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 20 Jul 2007 09:41:44 +0000 (09:41 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 20 Jul 2007 09:41:44 +0000 (09:41 +0000)
git-svn-id: file:///svn/unbound/trunk@445 be551aaa-1e26-0410-a405-d3ace91eadb9

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

index cdf230eb15082721e8b8836baf023b3f614f50cc..e0c8292981ff8b54f5cae2e9c995418d8434fb30 100644 (file)
@@ -5,6 +5,8 @@
          become a possibility. Note that still normalize scrubbing is done,
          and that the potentially spoofed data is used for infrastructure
          and not returned to the client.
+       - if glue times out, refetch by asking parent of delegation again.
+         Much like asking for DS at the parent side.
 
 19 July 2007: Wouter
        - shuffle NS selection when getting nameserver target addresses.
index f0038b288aba64d7d12e2be58f9514ece47bb70f..0d5a57eaed93462a7c63b0bb75872d35b3068c8e 100644 (file)
@@ -99,17 +99,6 @@ delegpt_add_ns(struct delegpt* dp, struct region* region, uint8_t* name)
        (void)dname_count_size_labels(name, &ns->namelen);
        ns->name = region_alloc_init(region, name, ns->namelen);
        ns->resolved = 0;
-
-       /* Sanity check: if the target name is at or *below* the 
-        * delegation point itself, then this will be (potentially) 
-        * unresolvable. This is the one case where glue *must* 
-        * have been present.
-        * FIXME: at this point, this *may* be resolvable, so 
-        * perhaps we should issue the query anyway and let it fail.*/
-       if(dname_subdomain_c(ns->name, dp->name)) {
-               ns->resolved = 1;
-       }
-
        return 1;
 }
 
index 1d4769873cef75f06e19b7d70c8617d142fe79b7..07a95bbaef5c01047d6581a5e34cb0acb4af1746 100644 (file)
@@ -114,6 +114,7 @@ iter_new(struct module_qstate* qstate, int id)
        iq->referral_count = 0;
        iq->priming = 0;
        iq->priming_stub = 0;
+       iq->refetch_glue = 0;
        iq->chase_flags = qstate->query_flags;
        /* Start with the (current) qname. */
        iq->qchase = qstate->qinfo;
@@ -405,6 +406,7 @@ generate_sub_request(uint8_t* qname, size_t qnamelen, uint16_t qtype,
                subiq->final_state = final_state;
                subiq->qchase = subq->qinfo;
                subiq->chase_flags = subq->query_flags;
+               subiq->refetch_glue = 0;
        }
        return 1;
 }
@@ -639,10 +641,12 @@ processInitRequest(struct module_qstate* qstate, struct iter_qstate* iq,
 
        /* first, adjust for DS queries. To avoid the grandparent problem, 
         * we just look for the closest set of server to the parent of qname.
+        * When re-fetching glue we also need to ask the parent.
         */
        delname = iq->qchase.qname;
        delnamelen = iq->qchase.qname_len;
-       if(iq->qchase.qtype == LDNS_RR_TYPE_DS && delname[0] != 0) {
+       if((iq->qchase.qtype == LDNS_RR_TYPE_DS || iq->refetch_glue)
+               && delname[0] != 0) {
                /* do not adjust root label, remove first label from delname */
                size_t lablen = delname[0] + 1;
                delname += lablen;
@@ -663,7 +667,7 @@ processInitRequest(struct module_qstate* qstate, struct iter_qstate* iq,
                if(!prime_root(qstate, iq, ie, id, iq->qchase.qclass))
                        return error_response(qstate, id, LDNS_RCODE_REFUSED);
 
-               /* priming creates an sends a subordinate query, with 
+               /* priming creates and sends a subordinate query, with 
                 * this query as the parent. So further processing for 
                 * this event will stop until reactivated by the results 
                 * of priming. */
@@ -772,13 +776,10 @@ generate_target_query(struct module_qstate* qstate, struct iter_qstate* iq,
        if(subq) {
                struct iter_qstate* subiq = 
                        (struct iter_qstate*)subq->minfo[id];
-               subiq->dp = delegpt_copy(iq->dp, subq->region);
-               if(!subiq->dp) {
-                       log_err("init targetq: out of memory");
-                       (*qstate->env->kill_sub)(subq);
-                       return 0;
+               if(dname_subdomain_c(name, iq->dp->name)) {
+                       verbose(VERB_ALGO, "refetch of target glue");
+                       subiq->refetch_glue = 1;
                }
-               delegpt_log(subiq->dp);
        }
        log_nametypeclass(VERB_DETAIL, "new target", name, qtype, qclass);
        return 1;
index f6587900dedfce42a4818aeda33a93e3d7c30f21..91a1c9ff751c9fc55782d2f6842917c2e7bad87d 100644 (file)
@@ -228,6 +228,14 @@ struct iter_qstate {
         */
        int priming_stub;
 
+       /**
+        * This is a flag that, if true, means that this query is
+        * for (re)fetching glue from a zone. Since the address should
+        * have been glue, query again to the servers that should have
+        * been returning it as glue.
+        */
+       int refetch_glue;
+
        /** list of pending queries to authoritative servers. */
        struct outbound_list outlist;
 };