mirror of
https://github.com/NLnetLabs/unbound.git
synced 2025-12-20 14:53:15 -05:00
RA bit on in cached responses.
caches responses with CNAMEs corrected. git-svn-id: file:///svn/unbound/trunk@375 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
parent
019816dcf1
commit
162b28bea1
3 changed files with 10 additions and 1 deletions
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue