From: Ubuntu Date: Wed, 29 Jul 2020 15:27:15 +0000 (+0000) Subject: Adjust semantics of TTL adjustment after feedback from @wcawijngaards X-Git-Tag: release-1.13.1rc1~7^2~1^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=21f175b1acc8e8766060e71e84a0c1913fc38c23;p=thirdparty%2Funbound.git Adjust semantics of TTL adjustment after feedback from @wcawijngaards --- diff --git a/cachedb/cachedb.c b/cachedb/cachedb.c index 6a2b735aa..e948a6b0d 100644 --- a/cachedb/cachedb.c +++ b/cachedb/cachedb.c @@ -465,7 +465,7 @@ packed_rrset_ttl_subtract(struct packed_rrset_data* data, time_t subtract) data->rr_ttl[i] -= subtract; else data->rr_ttl[i] = 0; } - data->ttl_add = 0; + data->ttl_add = (subtract < data->ttl_add) ? (data->ttl_add - subtract) : 0; } /* Adjust the TTL of a DNS message and its RRs by 'adjust'. If 'adjust' is