]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
When a cname is followed and ECS received, don't store result in msg cache.
authorYuri Schaeffer <yuri@nlnetlabs.nl>
Thu, 14 May 2015 13:03:32 +0000 (13:03 +0000)
committerYuri Schaeffer <yuri@nlnetlabs.nl>
Thu, 14 May 2015 13:03:32 +0000 (13:03 +0000)
git-svn-id: file:///svn/unbound/branches/edns-subnet@3423 be551aaa-1e26-0410-a405-d3ace91eadb9

iterator/iterator.c

index 526919622f112592a76ad4ae2904b1b8086508e0..e219db2d649b8b3f4adcfdc35d8ee4c22081c430 100644 (file)
@@ -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;