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:
parent
d679f2e7d0
commit
d60ce0c8d4
4 changed files with 14 additions and 8 deletions
5
plugin/cache/handler.go
vendored
5
plugin/cache/handler.go
vendored
|
@ -17,6 +17,7 @@ func (c *Cache) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg)
|
|||
rc := r.Copy() // We potentially modify r, to prevent other plugins from seeing this (r is a pointer), copy r into rc.
|
||||
state := request.Request{W: w, Req: rc}
|
||||
do := state.Do()
|
||||
ad := r.AuthenticatedData
|
||||
|
||||
zone := plugin.Zones(c.Zones).Matches(state.Name())
|
||||
if zone == "" {
|
||||
|
@ -36,7 +37,7 @@ func (c *Cache) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg)
|
|||
ttl := 0
|
||||
i := c.getIgnoreTTL(now, state, server)
|
||||
if i == nil {
|
||||
crr := &ResponseWriter{ResponseWriter: w, Cache: c, state: state, server: server, do: do}
|
||||
crr := &ResponseWriter{ResponseWriter: w, Cache: c, state: state, server: server, do: do, ad: ad}
|
||||
return c.doRefresh(ctx, state, crr)
|
||||
}
|
||||
ttl = i.ttl(now)
|
||||
|
@ -62,7 +63,7 @@ func (c *Cache) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg)
|
|||
cw := newPrefetchResponseWriter(server, state, c)
|
||||
go c.doPrefetch(ctx, state, cw, i, now)
|
||||
}
|
||||
resp := i.toMsg(r, now, do)
|
||||
resp := i.toMsg(r, now, do, ad)
|
||||
w.WriteMsg(resp)
|
||||
|
||||
return dns.RcodeSuccess, nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue