]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
Removed CD bit flags from cache.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Wed, 30 May 2007 05:39:04 +0000 (05:39 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Wed, 30 May 2007 05:39:04 +0000 (05:39 +0000)
git-svn-id: file:///svn/unbound/trunk@347 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
iterator/iterator.c
services/cache/dns.c
services/cache/dns.h
util/data/msgparse.c
util/data/msgreply.c
util/data/msgreply.h
util/data/packed_rrset.h

index cba15afc981ad563c76a5ef7e4c90cc02fd15bad..1192c876f01b07d2edf88b3a724430aedb1545ad 100644 (file)
@@ -1,3 +1,8 @@
+30 May 2007: Wouter
+       - removed FLAG_CD from message and rrset caches. This was useful for
+         an agnostic forwarder, but not for a sophisticated (trust value per
+         rrset enabled) cache.
+
 29 May 2007: Wouter
        - routines to lock and unlock array of rrsets moved to cache/rrset.
        - lookup message from msg cache (and copy to region).
index 259bc28c882d711c0cade583af4fac11c95e5541..2fca3f9d3052a353a8de091047c702d378eb1683 100644 (file)
@@ -124,8 +124,6 @@ fwd_new(struct module_qstate* qstate, int id)
                return 0;
        memset(iq, 0, sizeof(*iq));
        outbound_list_init(&iq->outlist);
-       if(qstate->qinfo.has_cd)
-               flags |= BIT_CD;
        e = (*env->send_query)(qstate->qinfo.qname, qstate->qinfo.qname_len,
                qstate->qinfo.qtype, qstate->qinfo.qclass, flags, dnssec, 
                &ie->fwd_addr, ie->fwd_addrlen, qstate);
@@ -403,8 +401,7 @@ processInitRequest(struct module_qstate* qstate, struct iter_qstate* iq,
        
        msg = dns_cache_lookup(qstate->env, qstate->qinfo.qname, 
                qstate->qinfo.qname_len, qstate->qinfo.qtype, 
-               qstate->qinfo.qclass, qstate->qinfo.has_cd, 
-               qstate->region, qstate->scratch);
+               qstate->qinfo.qclass, qstate->region, qstate->scratch);
        if(msg) {
                /* handle positive cache response */
                /*
index e028487bb42c38039b1872c0c55540490cc85bb1..fc0a3fef9fc5a2595d180067f8fb52965642b143 100644 (file)
@@ -317,7 +317,7 @@ tomsg(struct module_env* env, struct msgreply_entry* e, struct reply_info* r,
 struct dns_msg* 
 dns_cache_lookup(struct module_env* env,
        uint8_t* qname, size_t qnamelen, uint16_t qtype, uint16_t qclass,
-       int has_cd, struct region* region, struct region* scratch)
+       struct region* region, struct region* scratch)
 {
        struct lruhash_entry* e;
        struct query_info k;
@@ -329,7 +329,6 @@ dns_cache_lookup(struct module_env* env,
        k.qname_len = qnamelen;
        k.qtype = qtype;
        k.qclass = qclass;
-       k.has_cd = has_cd;
        h = query_info_hash(&k);
        e = slabhash_lookup(env->msg_cache, h, &k, 0);
        if(e) {
index da5959d52f7dc4678d0b0e770fec18ddd1fee8f3..584173d7c4b6bda5a24cdc278cd9822c3dee5137 100644 (file)
@@ -94,7 +94,6 @@ struct delegpt* dns_cache_find_delegation(struct module_env* env,
  * @param qnamelen: length of qname.
  * @param qtype: query type.
  * @param qclass: query class.
- * @param has_cd: if true, CD flag is turned on for lookup.
  * @param region: where to allocate result.
  * @param scratch: where to allocate temporary data.
  * @return new response message (alloced in region, rrsets do not have IDs).
@@ -103,7 +102,7 @@ struct delegpt* dns_cache_find_delegation(struct module_env* env,
  */
 struct dns_msg* dns_cache_lookup(struct module_env* env,
        uint8_t* qname, size_t qnamelen, uint16_t qtype, uint16_t qclass,
-       int has_cd, struct region* region, struct region* scratch);
+       struct region* region, struct region* scratch);
 
 /** Find covering DNAME */
 
index ebc88808a54ff06738f7618b6710e8935ad7454d..8a47f22f1e950918d51a87d4071a9443a62f4513 100644 (file)
@@ -143,12 +143,9 @@ nsec_at_apex(ldns_buffer* pkt)
 
 /** Calculate rrset flags */
 static uint32_t
-pkt_rrset_flags(struct msg_parse* msg, ldns_buffer* pkt, uint16_t type)
+pkt_rrset_flags(ldns_buffer* pkt, uint16_t type)
 {
-       uint32_t f;
-       if(msg->flags & BIT_CD)
-               f = PACKED_RRSET_CD;
-       else    f = 0;
+       uint32_t f = 0;
        if(type == LDNS_RR_TYPE_NSEC && nsec_at_apex(pkt)) {
                f |= PACKED_RRSET_NSEC_AT_APEX;
        }
@@ -450,7 +447,7 @@ find_rrset(struct msg_parse* msg, ldns_buffer* pkt, uint8_t* dname,
                }
        }
        /* find by hashing and lookup in hashtable */
-       *rrset_flags = pkt_rrset_flags(msg, pkt, type);
+       *rrset_flags = pkt_rrset_flags(pkt, type);
        
        /* if rrsig - try to lookup matching data set first */
        if(type == LDNS_RR_TYPE_RRSIG && pkt_rrsig_covered(pkt, 
index 15be1b9a68456c11e2beef67abf15a1dae74e955..23fdfaeb259375c0061c6942c40e7fe5df160120 100644 (file)
@@ -71,9 +71,6 @@ parse_create_qinfo(ldns_buffer* pkt, struct msg_parse* msg,
        qinf->qname_len = msg->qname_len;
        qinf->qtype = msg->qtype;
        qinf->qclass = msg->qclass;
-       qinf->has_cd = 0;
-       if(msg->flags & BIT_CD)
-               qinf->has_cd = 1;
        return 1;
 }
 
@@ -427,7 +424,6 @@ query_info_parse(struct query_info* m, ldns_buffer* query)
        log_assert(LDNS_OPCODE_WIRE(q) == LDNS_PACKET_QUERY);
        log_assert(LDNS_QDCOUNT(q) == 1);
        log_assert(ldns_buffer_position(query) == 0);
-       m->has_cd = LDNS_CD_WIRE(q)?1:0;
        ldns_buffer_skip(query, LDNS_HEADER_SIZE);
        m->qname = ldns_buffer_current(query);
        if((m->qname_len = query_dname_len(query)) == 0)
@@ -468,7 +464,6 @@ query_info_compare(void* m1, void* m2)
        if((mc = query_dname_compare(msg1->qname, msg2->qname)) != 0)
                return mc;
        log_assert(msg1->qname_len == msg2->qname_len);
-       COMPARE_IT(msg1->has_cd, msg2->has_cd);
        COMPARE_IT(msg1->qclass, msg2->qclass);
        return 0;
 #undef COMPARE_IT
@@ -518,7 +513,6 @@ query_info_hash(struct query_info *q)
        hashvalue_t h = 0xab;
        h = hashlittle(&q->qtype, sizeof(q->qtype), h);
        h = hashlittle(&q->qclass, sizeof(q->qclass), h);
-       h = hashlittle(&q->has_cd, sizeof(q->has_cd), h);
        h = dname_query_hash(q->qname, h);
        return h;
 }
@@ -1161,8 +1155,6 @@ void
 qinfo_query_encode(ldns_buffer* pkt, struct query_info* qinfo)
 {
        uint16_t flags = 0; /* QUERY, NOERROR */
-       if(qinfo->has_cd)
-               flags |= BIT_CD;
        ldns_buffer_clear(pkt);
        log_assert(ldns_buffer_remaining(pkt) >= 12+255+4/*max query*/);
        ldns_buffer_skip(pkt, 2); /* id done later */
index 5533dd23f72b067e67436c039232df3c227bc747..38d49bf8a6ff0882144da5c3f03e1e9a5cfa0b2e 100644 (file)
@@ -66,8 +66,6 @@ struct query_info {
        uint16_t qtype;
        /** qclass, host byte order */
        uint16_t qclass;
-       /** does query have CD bit set */
-       int has_cd;
 };
 
 /**
index 757d14ce97dbea5747bf67a367a285be2b84355b..64c12ebeb81cb986c1525a41c74020edcf6ac82f 100644 (file)
@@ -48,10 +48,8 @@ struct alloc_cache;
  * clearing the cache. */
 typedef uint64_t rrset_id_t;
 
-/** this rrset is NSEC/NSEC3 and is at zone apex (at child size of zonecut) */
+/** this rrset is NSEC and is at zone apex (at child side of zonecut) */
 #define PACKED_RRSET_NSEC_AT_APEX 0x1
-/** this rrset was obtained and is used for checking-disabled replies. */
-#define PACKED_RRSET_CD 0x2
 
 /**
  * The identifying information for an RRset.
@@ -70,7 +68,6 @@ struct packed_rrset_key {
        /**
         * Flags. 32bit to be easy for hashing:
         *      o PACKED_RRSET_NSEC_AT_APEX
-        *      o PACKED_RRSET_CD
         */
        uint32_t flags;
        /** the rrset type in network format */