From: W.C.A. Wijngaards Date: Fri, 10 Jan 2020 09:04:50 +0000 (+0100) Subject: - Fix the relationship between serve-expired and prefetch options, X-Git-Tag: release-1.10.0rc1~55 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a8db52120b3d3ac078601ed875e8eac92bbbae65;p=thirdparty%2Funbound.git - Fix the relationship between serve-expired and prefetch options, patch from Saksham Manchanda from Secure64. --- diff --git a/daemon/worker.c b/daemon/worker.c index e2ce0e870..aa16650ec 100644 --- a/daemon/worker.c +++ b/daemon/worker.c @@ -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 diff --git a/doc/Changelog b/doc/Changelog index 5b699af01..c14e79617 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -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.