aboutsummaryrefslogtreecommitdiff
path: root/plugin/cache/dnssec.go (follow)
AgeCommit message (Collapse)AuthorFilesLines
2021-01-20Fix some typos (#4412)Gravatar ZouYu 1-1/+1
Signed-off-by: zouyu <zouy.fnst@cn.fujitsu.com>
2020-10-14plugin/cache: fix removing OPT (#4190)Gravatar Miek Gieben 1-0/+3
By checking state.Do() were are checking if the request had DO, but we are _always_ adding Do now - do we need to save the DO from the ORIGINAL request, which must be done in the ResponseWriter. Also skip OPT records in filterDNSSEC as we can't set the TTL on those records, this prevents writing a number to OPT's MBZ. Note none of the tests have changed and still PASS. This is due to the fact that CoreDNSServerAndPorts isn't a full server as we start in main, it lacks the scrubwriter for instance. This is not bad per se, but should be documented in the test code. Signed-off-by: Miek Gieben <miek@miek.nl>
2020-09-28plugin/cache: Fix filtering (#4148)Gravatar Miek Gieben 1-0/+43
The filtering of DNSSEC records in the cache plugin was not done correctly. Also the change to introduced this bug didn't take into account that the cache - by virtue of differentiating between DNSSEC and no-DNSSEC - relied on not copying the data from the cache. This change copies and then filters the data and factors the filtering into a function that is used in two places (albeit with on ugly boolean parameters to prevent copying things twice). Add tests, do_test.go is moved to test/cache_test.go because the OPT handing is done outside of the cache plugin. The core server re-attaches the correct OPT when replying, so that makes for a better e2e test. Added small unit test for filterRRslice and an explicit test that asks for DNSSEC first and then plain, and vice versa to test cache behavior. Fixes: #4146 Signed-off-by: Miek Gieben <miek@miek.nl>