]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix the relationship between serve-expired and prefetch options,
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Fri, 10 Jan 2020 09:04:50 +0000 (10:04 +0100)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Fri, 10 Jan 2020 09:04:50 +0000 (10:04 +0100)
  patch from Saksham Manchanda from Secure64.

daemon/worker.c
doc/Changelog

index e2ce0e87009be6f9596d13810938e872a7a60e48..aa16650ec7a629d159bc8ba2d4b1ad8784a3498d 100644 (file)
@@ -1468,9 +1468,11 @@ lookup_cache:
                                 * Note that if there is more than one pass
                                 * its qname must be that used for cache
                                 * lookup. */
-                               if((worker->env.cfg->prefetch || worker->env.cfg->serve_expired)
-                                       && *worker->env.now >=
-                                       ((struct reply_info*)e->data)->prefetch_ttl) {
+                               if((worker->env.cfg->prefetch && *worker->env.now >=
+                                                       ((struct reply_info*)e->data)->prefetch_ttl) ||
+                                               (worker->env.cfg->serve_expired &&
+                                               *worker->env.now >= ((struct reply_info*)e->data)->ttl)) {
+
                                        time_t leeway = ((struct reply_info*)e->
                                                data)->ttl - *worker->env.now;
                                        if(((struct reply_info*)e->data)->ttl
index 5b699af01b21dda868eb5bd4840588a2982d8937..c14e796174c1058e3016e091af53360bd59b9061 100644 (file)
@@ -1,3 +1,7 @@
+10 January 2020: Wouter
+       - Fix the relationship between serve-expired and prefetch options,
+         patch from Saksham Manchanda from Secure64.
+
 8 January 2020: Ralph
        - Fix #138: stop binding pidfile inside chroot dir in systemd service
          file.