aboutsummaryrefslogtreecommitdiff
path: root/plugin/cache/dnssec.go
diff options
context:
space:
mode:
authorGravatar Grant Spence <gcs278@vt.edu> 2022-10-21 09:29:04 -0600
committerGravatar GitHub <noreply@github.com> 2022-10-21 11:29:04 -0400
commit403e979934254713789ec9eef7a5127758104c8e (patch)
tree34903db6ec3c03055e28c0cccdfec758c929f839 /plugin/cache/dnssec.go
parentc6fa91b36704795997ed3953221317990c10cc30 (diff)
downloadcoredns-403e979934254713789ec9eef7a5127758104c8e.tar.gz
coredns-403e979934254713789ec9eef7a5127758104c8e.tar.zst
coredns-403e979934254713789ec9eef7a5127758104c8e.zip
plugin/cache: cache now uses source query DNSSEC option for upstream refresh (#5671)
Signed-off-by: Grant Spence <gspence@redhat.com> Signed-off-by: Grant Spence <gspence@redhat.com>
Diffstat (limited to 'plugin/cache/dnssec.go')
-rw-r--r--plugin/cache/dnssec.go28
1 files changed, 3 insertions, 25 deletions
diff --git a/plugin/cache/dnssec.go b/plugin/cache/dnssec.go
index cf908037e..ec5ff41cb 100644
--- a/plugin/cache/dnssec.go
+++ b/plugin/cache/dnssec.go
@@ -2,35 +2,13 @@ package cache
import "github.com/miekg/dns"
-// isDNSSEC returns true if r is a DNSSEC record. NSEC,NSEC3,DS and RRSIG/SIG
-// are DNSSEC records. DNSKEYs is not in this list on the assumption that the
-// client explicitly asked for it.
-func isDNSSEC(r dns.RR) bool {
- switch r.Header().Rrtype {
- case dns.TypeNSEC:
- return true
- case dns.TypeNSEC3:
- return true
- case dns.TypeDS:
- return true
- case dns.TypeRRSIG:
- return true
- case dns.TypeSIG:
- return true
- }
- return false
-}
-
-// filterRRSlice filters rrs and removes DNSSEC RRs when do is false. In the returned slice
-// the TTLs are set to ttl. If dup is true the RRs in rrs are _copied_ into the slice that is
+// filterRRSlice filters out OPT RRs, and sets all RR TTLs to ttl.
+// If dup is true the RRs in rrs are _copied_ into the slice that is
// returned.
-func filterRRSlice(rrs []dns.RR, ttl uint32, do, dup bool) []dns.RR {
+func filterRRSlice(rrs []dns.RR, ttl uint32, dup bool) []dns.RR {
j := 0
rs := make([]dns.RR, len(rrs))
for _, r := range rrs {
- if !do && isDNSSEC(r) {
- continue
- }
if r.Header().Rrtype == dns.TypeOPT {
continue
}