From: Wouter Wijngaards Date: Mon, 23 Jul 2012 13:42:07 +0000 (+0000) Subject: - implemented forward_first for the root. X-Git-Tag: release-1.4.18rc1~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3c55073799728850ac215c33a1c381c74192449c;p=thirdparty%2Funbound.git - implemented forward_first for the root. git-svn-id: file:///svn/unbound/trunk@2722 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/doc/Changelog b/doc/Changelog index 277cc285c..4fba2c7d3 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,5 +1,6 @@ 23 July 2012: Wouter - fix missing break for GOST DS hash function. + - implemented forward_first for the root. 20 July 2012: Wouter - Fix bug#452 and another assertion failure in mesh.c, makes diff --git a/iterator/iterator.c b/iterator/iterator.c index 6399fdeec..14f1bc6a0 100644 --- a/iterator/iterator.c +++ b/iterator/iterator.c @@ -1430,7 +1430,24 @@ processLastResort(struct module_qstate* qstate, struct iter_qstate* iq, verbose(VERB_ALGO, "No more query targets, attempting last resort"); log_assert(iq->dp); - if(!iq->dp->has_parent_side_NS) { + if(!iq->dp->has_parent_side_NS && dname_is_root(iq->dp->name)) { + struct delegpt* p = hints_lookup_root(qstate->env->hints, + iq->qchase.qclass); + if(p) { + struct delegpt_ns* ns; + struct delegpt_addr* a; + for(ns = p->nslist; ns; ns=ns->next) { + (void)delegpt_add_ns(iq->dp, qstate->region, + ns->name, (int)ns->lame); + } + for(a = p->target_list; a; a=a->next_target) { + (void)delegpt_add_addr(iq->dp, qstate->region, + &a->addr, a->addrlen, a->bogus, + a->lame); + } + } + iq->dp->has_parent_side_NS = 1; + } else if(!iq->dp->has_parent_side_NS) { if(!iter_lookup_parent_NS_from_cache(qstate->env, iq->dp, qstate->region, &qstate->qinfo) || !iq->dp->has_parent_side_NS) {