mirror of
https://github.com/coredns/coredns.git
synced 2025-11-12 23:12:17 -05:00
Don't add OPT RR to non-EDNS0 queries (#5368)
* Don't add OPT RR to non-EDNS0 queries Signed-off-by: Patrick W. Healy <phealy@phealy.com> Signed-off-by: Patrick W. Healy <patrick.healy@microsoft.com> * Update plugin/bufsize/README.md Co-authored-by: Chris O'Haver <cohaver@infoblox.com> Signed-off-by: Patrick W. Healy <patrick.healy@microsoft.com> Co-authored-by: Chris O'Haver <cohaver@infoblox.com>
This commit is contained in:
@@ -19,9 +19,6 @@ type Bufsize struct {
|
||||
func (buf Bufsize) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error) {
|
||||
if option := r.IsEdns0(); option != nil {
|
||||
option.SetUDPSize(uint16(buf.Size))
|
||||
} else {
|
||||
// If a client does not use EDNS, add it
|
||||
r.SetEdns0(uint16(buf.Size), false)
|
||||
}
|
||||
|
||||
return plugin.NextOrFailure(buf.Name(), buf.Next, ctx, w, r)
|
||||
|
||||
Reference in New Issue
Block a user