From: Yuri Schaeffer Date: Thu, 14 May 2015 13:03:32 +0000 (+0000) Subject: When a cname is followed and ECS received, don't store result in msg cache. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ccfc0cd195219586f123f0d04c3f5cead5a0c602;p=thirdparty%2Funbound.git When a cname is followed and ECS received, don't store result in msg cache. git-svn-id: file:///svn/unbound/branches/edns-subnet@3423 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/iterator/iterator.c b/iterator/iterator.c index 526919622..e219db2d6 100644 --- a/iterator/iterator.c +++ b/iterator/iterator.c @@ -2774,10 +2774,18 @@ processFinished(struct module_qstate* qstate, struct iter_qstate* iq, * but only if we did recursion. The nonrecursion referral * from cache does not need to be stored in the msg cache. */ if(qstate->query_flags&BIT_RD) { +#ifdef CLIENT_SUBNET + /* Do not cache, we asked for and got subnet option */ + if(!qstate->edns_server_in.subnet_validdata || + !qstate->edns_server_out.subnet_sent) { +#endif iter_dns_store(qstate->env, &qstate->qinfo, iq->response->rep, 0, qstate->prefetch_leeway, iq->dp&&iq->dp->has_parent_side_NS, qstate->region, qstate->query_flags); +#ifdef CLIENT_SUBNET + } +#endif } } qstate->return_rcode = LDNS_RCODE_NOERROR;