]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
RA bit on in cached responses.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Thu, 7 Jun 2007 14:20:23 +0000 (14:20 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Thu, 7 Jun 2007 14:20:23 +0000 (14:20 +0000)
caches responses with CNAMEs corrected.

git-svn-id: file:///svn/unbound/trunk@375 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
iterator/iter_utils.c
iterator/iterator.c

index fadc7028910e383de6bd8265c3f23953b475417b..3238d43feead1b029446d465e2b192572b45e78b 100644 (file)
@@ -11,6 +11,8 @@
        - subreq insertion code fixup for slumber list.
        - VERB_DETAIL, verbosity: 2 level gives short but readable output.
          VERB_ALGO, verbosity: 3 gives extensive output.
+       - fixup RA bit in cached replies.
+       - fixup CNAME responses from the cache no longer partial response.
 
 5 June 2007: Wouter
        - iterator state finished.
index 64ae6f91801db408e78c229ba05b202ecdcd02d0..c9aeb125cb7a2066b99a36f8f04656f92533999c 100644 (file)
@@ -268,6 +268,11 @@ iter_dns_store(struct module_env* env, struct dns_msg* msg, int is_referral)
                qinf.qname = memdup(msg->qinfo.qname, msg->qinfo.qname_len);
                if(!qinf.qname)
                        return 0;
+               /* fixup flags to be sensible for a reply based on the cache */
+               /* this module means that RA is available. It is an answer QR. 
+                * Not AA from cache. Not CD in cache (depends on client bit). */
+               rep->flags |= (BIT_RA | BIT_QR);
+               rep->flags &= ~(BIT_AA | BIT_CD);
                h = query_info_hash(&qinf);
                dns_cache_store_msg(env, &qinf, h, rep);
                free(qinf.qname);
index 6ab1de9757de3094a34c57e421288dea8233b32e..6dcdc0487334151529a3b4ffbe7e79f8fa1440f0 100644 (file)
@@ -1178,7 +1178,9 @@ processQueryResponse(struct module_qstate* qstate, struct iter_qstate* iq,
                        &sname, &snamelen))
                        return error_response(qstate, id, LDNS_RCODE_SERVFAIL);
                /* cache the CNAME response under the current query */
-               if(!iter_dns_store(qstate->env, iq->response, 0))
+               /* NOTE : set referral=1, so that rrsets get stored but not 
+                * the partial query answer (CNAME only). */
+               if(!iter_dns_store(qstate->env, iq->response, 1))
                        return error_response(qstate, id, LDNS_RCODE_SERVFAIL);
                /* set the current request's qname to the new value. */
                qstate->qinfo.qname = sname;