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.
(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;
}
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;
subiq->final_state = final_state;
subiq->qchase = subq->qinfo;
subiq->chase_flags = subq->query_flags;
+ subiq->refetch_glue = 0;
}
return 1;
}
/* 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;
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. */
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;
*/
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;
};