]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
Fixup cname target name readout.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Thu, 7 Jun 2007 10:38:02 +0000 (10:38 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Thu, 7 Jun 2007 10:38:02 +0000 (10:38 +0000)
git-svn-id: file:///svn/unbound/trunk@373 be551aaa-1e26-0410-a405-d3ace91eadb9

daemon/worker.c
doc/Changelog
iterator/iter_resptype.c
services/outside_network.c
util/data/packed_rrset.c

index e1abbe5192e1da53744a6c24c62cd5ffb3a8513b..de30e0daa0e70eab38d0e02607ec3e57efd235ec 100644 (file)
@@ -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);
 }
 
index 2e8221b5c9f7740e37a881788eaa7635b3519063..4a4acf9d11639df456a266f7ffba1a8181201415 100644 (file)
@@ -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.
index fc2d7031b48e4cb6f835f8ebfd9e2c17790cfadf..a5c15850bdff69ea6b5e0531b70bf86498c1c1ee 100644 (file)
@@ -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 
index 0c65f41e185da8a4915445937b3122e370e8ccf7..8a02c4cd7315387de07ff1c6090a62085d342a2c 100644 (file)
@@ -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;
        }
 
index dc1099b30f330a54e175df013c90dcdedc596420..3d8a45cbbbdd0eb878f04d34ddb1032b4368bd80 100644 (file)
@@ -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);