Fix to prevent non-referal query from being cached as referal when the
no_cache_store flag was set.
@@ -2089,14 +2089,16 @@ 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(!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 */
