bind9/bin/tests
Matthijs Mekking 2a5e0232ed Fix nonsensical stale TTL values in cache dump
When introducing change 5149, "rndc dumpdb" started to print a line
above a stale RRset, indicating how long the data will be retained.

At that time, I thought it should also be possible to load
a cache from file. But if a TTL has a value of 0 (because it is stale),
stale entries wouldn't be loaded from file. So, I added the
'max-stale-ttl' to TTL values, and adjusted the $DATE accordingly.

Since we actually don't have a "load cache from file" feature, this
is premature and is causing confusion at operators. This commit
changes the 'max-stale-ttl' adjustments.

A check in the serve-stale system test is added for a non-stale
RRset (longttl.example) to make sure the TTL in cache is sensible.

Also, the comment above stale RRsets could have nonsensical
values. A possible reason why this may happen is when the RRset was
marked a stale but the 'max-stale-ttl' has passed (and is actually an
RRset awaiting cleanup). This would lead to the "will be retained"
value to be negative (but since it is stored in an uint32_t, you would
get a nonsensical value (e.g. 4294362497).

To mitigate against this, we now also check if the header is not
ancient. In addition we check if the stale_ttl would be negative, and
if so we set it to 0. Most likely this will not happen because the
header would already have been marked ancient, but there is a possible
race condition where the 'rdh_ttl + serve_stale_ttl' has passed,
but the header has not been checked for staleness.
2021-04-13 09:48:20 +02:00
..
startperf update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
system Fix nonsensical stale TTL values in cache dump 2021-04-13 09:48:20 +02:00
testdata/wire move all optional tests from bin/tests to bin/tests/optional 2018-03-09 14:12:47 -08:00
.gitignore Refactor TLSDNS module to work with libuv/ssl directly 2021-01-25 09:19:22 +01:00
Makefile.am Refactor TLSDNS module to work with libuv/ssl directly 2021-01-25 09:19:22 +01:00
named.conf Remove a lot of obsoleted options 2021-01-19 10:12:40 +01:00
prepare-softhsm2.sh update all copyright headers to eliminate the typo 2020-09-14 16:20:40 -07:00
test_client.c isc_nm_*connect() always return via callback 2021-04-07 15:36:59 +02:00
test_server.c DoH: call send callbacks after data was actually sent 2021-03-05 13:29:32 +02:00
wire_test.c Silence CID 320481: Null pointer dereferences 2021-02-23 12:45:45 +00:00