]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix to prevent non-referal query from being cached as referal when the
authorGeorge Thessalonikefs <george@nlnetlabs.nl>
Fri, 24 Mar 2017 10:51:56 +0000 (10:51 +0000)
committerGeorge Thessalonikefs <george@nlnetlabs.nl>
Fri, 24 Mar 2017 10:51:56 +0000 (10:51 +0000)
  no_cache_store flag was set.

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

validator/validator.c

index 676dcdfe4d8bf21744d9ff151c1d57007dae4202..81ba5fa17ba2accc7e423ee8d6c9afcd976f7ef0 100644 (file)
@@ -2089,18 +2089,20 @@ processFinished(struct module_qstate* qstate, struct val_qstate* vq,
        }
 
        /* store results in cache */
-       if(!qstate->no_cache_store && qstate->query_flags&BIT_RD) {
+       if(qstate->query_flags&BIT_RD) {
                /* if secure, this will override cache anyway, no need
                 * to check if from parentNS */
-               if(!dns_cache_store(qstate->env, &vq->orig_msg->qinfo, 
-                       vq->orig_msg->rep, 0, qstate->prefetch_leeway, 0, NULL,
-                       qstate->query_flags)) {
-                       log_err("out of memory caching validator results");
+               if(!qstate->no_cache_store) {
+                       if(!dns_cache_store(qstate->env, &vq->orig_msg->qinfo,
+                               vq->orig_msg->rep, 0, qstate->prefetch_leeway, 0, NULL,
+                               qstate->query_flags)) {
+                               log_err("out of memory caching validator results");
+                       }
                }
        } else {
                /* for a referral, store the verified RRsets */
                /* and this does not get prefetched, so no leeway */
-               if(!dns_cache_store(qstate->env, &vq->orig_msg->qinfo, 
+               if(!dns_cache_store(qstate->env, &vq->orig_msg->qinfo,
                        vq->orig_msg->rep, 1, 0, 0, NULL,
                        qstate->query_flags)) {
                        log_err("out of memory caching validator results");