mirror of
https://github.com/coredns/coredns.git
synced 2025-10-28 00:34:24 -04:00
retain response AD bit if requestor's AD bit was set (#5191)
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
This commit is contained in:
7
plugin/cache/cache.go
vendored
7
plugin/cache/cache.go
vendored
@@ -109,6 +109,7 @@ type ResponseWriter struct {
|
||||
server string // Server handling the request.
|
||||
|
||||
do bool // When true the original request had the DO bit set.
|
||||
ad bool // When true the original request had the AD bit set.
|
||||
prefetch bool // When true write nothing back to the client.
|
||||
remoteAddr net.Addr
|
||||
}
|
||||
@@ -185,8 +186,10 @@ func (w *ResponseWriter) WriteMsg(res *dns.Msg) error {
|
||||
res.Ns = filterRRSlice(res.Ns, ttl, w.do, false)
|
||||
res.Extra = filterRRSlice(res.Extra, ttl, w.do, false)
|
||||
|
||||
if !w.do {
|
||||
res.AuthenticatedData = false // unset AD bit if client is not OK with DNSSEC
|
||||
if !w.do && !w.ad {
|
||||
// unset AD bit if requester is not OK with DNSSEC
|
||||
// But retain AD bit if requester set the AD bit in the request, per RFC6840 5.7-5.8
|
||||
res.AuthenticatedData = false
|
||||
}
|
||||
|
||||
return w.ResponseWriter.WriteMsg(res)
|
||||
|
||||
Reference in New Issue
Block a user