]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
store if ttl expired
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 14 Jan 2011 15:23:51 +0000 (15:23 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 14 Jan 2011 15:23:51 +0000 (15:23 +0000)
git-svn-id: file:///svn/unbound/trunk@2374 be551aaa-1e26-0410-a405-d3ace91eadb9

services/cache/rrset.c

index c42a741ea40fcb65e104fe02293b73988dc55c1d..6677596a99a3b11e3879d62b492e173121c31f2e 100644 (file)
@@ -352,7 +352,8 @@ rrset_update_sec_status(struct rrset_cache* r,
                cachedata->security = updata->security;
                /* for NS records only shorter TTLs, other types: update it */
                if(ntohs(rrset->rk.type) != LDNS_RR_TYPE_NS ||
-                       updata->ttl+now < cachedata->ttl) {
+                       updata->ttl+now < cachedata->ttl ||
+                       cachedata->ttl < now) {
                        cachedata->ttl = updata->ttl + now;
                        for(i=0; i<cachedata->count+cachedata->rrsig_count; i++)
                                cachedata->rr_ttl[i] = updata->rr_ttl[i]+now;