mirror of
https://github.com/NLnetLabs/unbound.git
synced 2026-02-18 10:09:27 -05:00
Fixup cname target name readout.
git-svn-id: file:///svn/unbound/trunk@373 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
parent
01c703d3e6
commit
a11cc0c530
5 changed files with 30 additions and 6 deletions
|
|
@ -210,17 +210,33 @@ set_extstates_initial(struct worker* worker, struct module_qstate* qstate)
|
|||
qstate->ext_state[i] = module_state_initial;
|
||||
}
|
||||
|
||||
/** recursive debug logging of (sub)query structure */
|
||||
static void
|
||||
run_debug(struct module_qstate* p, int d)
|
||||
{
|
||||
char buf[80+1+1]; /* max nn=80; marker is 1, zero at end is 1 */
|
||||
int i, nn = d*2;
|
||||
if(nn > 80)
|
||||
nn = 80;
|
||||
for(i=0; i<nn; i++) {
|
||||
buf[i] = ' ';
|
||||
}
|
||||
buf[i++] = 'o';
|
||||
buf[i] = 0;
|
||||
log_nametypeclass(buf, p->qinfo.qname, p->qinfo.qtype, p->qinfo.qclass);
|
||||
for(p = p->subquery_first; p; p = p->subquery_next) {
|
||||
run_debug(p, d+1);
|
||||
}
|
||||
}
|
||||
|
||||
/** find runnable recursive */
|
||||
static struct module_qstate*
|
||||
find_run_in(struct module_qstate* p)
|
||||
{
|
||||
struct module_qstate* q;
|
||||
log_nametypeclass("find run in", p->qinfo.qname, p->qinfo.qtype, p->qinfo.qclass);
|
||||
for(p = p->subquery_first; p; p = p->subquery_next) {
|
||||
log_nametypeclass("find run passed", p->qinfo.qname, p->qinfo.qtype, p->qinfo.qclass);
|
||||
if(p->ext_state[p->curmod] == module_state_initial)
|
||||
return p;
|
||||
log_nametypeclass("find run morepass", p->qinfo.qname, p->qinfo.qtype, p->qinfo.qclass);
|
||||
if((q=find_run_in(p)))
|
||||
return q;
|
||||
}
|
||||
|
|
@ -238,6 +254,8 @@ find_runnable(struct module_qstate* subq)
|
|||
return p->subquery_next;
|
||||
while(p->parent)
|
||||
p = p->parent;
|
||||
if(verbosity >= VERB_ALGO)
|
||||
run_debug(p, 0);
|
||||
return find_run_in(p);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
7 June 2007: Wouter
|
||||
- fixup error in double linked list insertion for subqueries and
|
||||
for outbound list of serviced queries for iterator module.
|
||||
- nicer printout of outgoing port selection.
|
||||
- nicer printout of outgoing port selection.
|
||||
- fixup cname target readout.
|
||||
- nicer debug output.
|
||||
|
||||
5 June 2007: Wouter
|
||||
- iterator state finished.
|
||||
|
|
|
|||
|
|
@ -159,7 +159,9 @@ response_type_from_server(struct dns_msg* msg, struct query_info* request,
|
|||
* it is relevant. */
|
||||
if(ntohs(s->rk.type) == LDNS_RR_TYPE_CNAME &&
|
||||
query_dname_compare(mname, s->rk.dname) == 0) {
|
||||
log_nametypeclass("following CNAME from", mname, LDNS_RR_TYPE_CNAME, request->qclass);
|
||||
get_cname_target(s, &mname, &mname_len);
|
||||
log_nametypeclass("following CNAME to", mname, request->qtype, request->qclass);
|
||||
}
|
||||
}
|
||||
/* if we encountered a CNAME (or a bunch of CNAMEs), and
|
||||
|
|
|
|||
|
|
@ -285,12 +285,15 @@ outnet_udp_cb(struct comm_point* c, void* arg, int error,
|
|||
memcpy(&key.addr, &reply_info->addr, reply_info->addrlen);
|
||||
key.addrlen = reply_info->addrlen;
|
||||
verbose(VERB_ALGO, "Incoming reply id=%4.4x addr=", key.id);
|
||||
if(verbosity >= VERB_ALGO) {
|
||||
log_addr("Incoming reply addr=", &reply_info->addr, reply_info->addrlen);
|
||||
}
|
||||
|
||||
/* find it, see if this thing is a valid query response */
|
||||
verbose(VERB_ALGO, "lookup size is %d entries", (int)outnet->pending->count);
|
||||
p = (struct pending*)rbtree_search(outnet->pending, &key);
|
||||
if(!p) {
|
||||
verbose(VERB_DETAIL, "received unsolicited udp reply. dropped.");
|
||||
verbose(VERB_DETAIL, "received unwanted or unsolicited udp reply dropped.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -207,7 +207,6 @@ get_cname_target(struct ub_packed_rrset_key* rrset, uint8_t** dname,
|
|||
len = ldns_read_uint16(d->rr_data[0]);
|
||||
if(len != d->rr_len[0] - sizeof(uint16_t))
|
||||
return;
|
||||
len -= sizeof(uint16_t);
|
||||
if(dname_valid(d->rr_data[0]+sizeof(uint16_t), len) != len)
|
||||
return;
|
||||
*dname = d->rr_data[0]+sizeof(uint16_t);
|
||||
|
|
|
|||
Loading…
Reference in a new issue