]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
No verbose for packet error. TC detect.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Mon, 7 May 2007 15:01:27 +0000 (15:01 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Mon, 7 May 2007 15:01:27 +0000 (15:01 +0000)
git-svn-id: file:///svn/unbound/trunk@293 be551aaa-1e26-0410-a405-d3ace91eadb9

daemon/worker.c
util/data/msgparse.c

index 22638002ce629e0f114b3839d84bfbe2c9d70927..e6a1f471897f932ccb00b534c0c1d119a596dda5 100644 (file)
@@ -234,6 +234,11 @@ worker_handle_reply(struct comm_point* c, void* arg, int error,
                return 0; /* not a reply to a query. */
        if(LDNS_QDCOUNT(ldns_buffer_begin(c->buffer)) > 1)
                return 0; /* too much in the query section */
+       /* see if it is truncated */
+       if(LDNS_TC_WIRE(ldns_buffer_begin(c->buffer)) && c->type == comm_udp) {
+               log_info("TC: truncated. retry in TCP mode.");
+               return 0;
+       }
        /* woohoo a reply! */
        if((r=reply_info_parse(c->buffer, &w->worker->alloc, &qinf, &rep,
                w->worker->scratchpad, &svr_edns))!=0) {
index 71b9246d1aa04287b44f9b31d863906990db68b6..01964477d2a8e13305a1418a198d6b77a8cca54d 100644 (file)
@@ -694,11 +694,17 @@ add_rr_to_rrset(struct rrset_parse* rrset, ldns_buffer* pkt,
        /* check section of rrset. */
        if(rrset->section != section && type != LDNS_RR_TYPE_RRSIG &&
                rrset->type != LDNS_RR_TYPE_RRSIG) {
-               /* silently drop it - it is a security problem, since
+               /* silently drop it - we drop the last part, since
                 * trust in rr data depends on the section it is in. 
-                * the less trustworthy part is discarded. */
+                * the less trustworthy part is discarded. 
+                * also the last part is more likely to be incomplete.
+                * RFC 2181: must put RRset only once in response. */
+               /*
                verbose(VERB_DETAIL, "Packet contains rrset data in "
                        "multiple sections, dropped last part.");
+               log_hex("packet was: ", ldns_buffer_begin(pkt), 
+                       ldns_buffer_limit(pkt));
+               */
                /* forwards */
                if(!skip_ttl_rdata(pkt))
                        return LDNS_RCODE_FORMERR;