diff options
author | 2021-01-28 16:50:35 +0100 | |
---|---|---|
committer | 2021-01-28 16:50:35 +0100 | |
commit | 60e1490ed6c37991ec470cecb30615123ecbee05 (patch) | |
tree | 236cd5b0ee4d8639a251f48eabffced23637a50b /plugin | |
parent | d8d2c169055420a86584e7511ceda539e072b625 (diff) | |
download | coredns-60e1490ed6c37991ec470cecb30615123ecbee05.tar.gz coredns-60e1490ed6c37991ec470cecb30615123ecbee05.tar.zst coredns-60e1490ed6c37991ec470cecb30615123ecbee05.zip |
copy rrs (#4416)
* Revert "make copies of RRs before returning them (#4409)"
This reverts commit 8b2ff6c3889e0c23dceef4b10a1b1de58e463cb9.
* Document copying responses
See #4409 and the comments. This documents that issue, but doesn't
change the in-tree plugins just yet.
Signed-off-by: Miek Gieben <miek@miek.nl>
* Update plugin.md
Co-authored-by: Chris O'Haver <cohaver@infoblox.com>
Co-authored-by: Chris O'Haver <cohaver@infoblox.com>
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/file/lookup.go | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/plugin/file/lookup.go b/plugin/file/lookup.go index cba1eec50..6eeb4c397 100644 --- a/plugin/file/lookup.go +++ b/plugin/file/lookup.go @@ -171,12 +171,7 @@ func (z *Zone) Lookup(ctx context.Context, state request.Request, qname string) return z.externalLookup(ctx, state, elem, rrs) } - treeRRs := elem.Type(qtype) - // make a copy of the element RRs to prevent response writers from mutating the tree - rrs := make([]dns.RR, len(treeRRs)) - for i, rr := range treeRRs { - rrs[i] = dns.Copy(rr) - } + rrs := elem.Type(qtype) // NODATA if len(rrs) == 0 { |