mirror of
https://github.com/coredns/coredns.git
synced 2026-10-09 03:55:21 -04:00
request: stop echoing unhandled EDNS options (#8514)
Signed-off-by: houyuwushang <liuluoqianqiu@outlook.com>
This commit is contained in:
@@ -7,24 +7,10 @@ import (
|
||||
)
|
||||
|
||||
func supportedOptions(o []dns.EDNS0) []dns.EDNS0 {
|
||||
var supported = make([]dns.EDNS0, 0, 3)
|
||||
// For as long as possible try avoid looking up in the map, because that need an Rlock.
|
||||
supported := make([]dns.EDNS0, 0, 3)
|
||||
for _, opt := range o {
|
||||
switch code := opt.Option(); code {
|
||||
case dns.EDNS0NSID:
|
||||
fallthrough
|
||||
case dns.EDNS0EXPIRE:
|
||||
fallthrough
|
||||
case dns.EDNS0COOKIE:
|
||||
fallthrough
|
||||
case dns.EDNS0TCPKEEPALIVE:
|
||||
fallthrough
|
||||
case dns.EDNS0PADDING:
|
||||
if edns.SupportedOption(opt.Option()) {
|
||||
supported = append(supported, opt)
|
||||
default:
|
||||
if edns.SupportedOption(code) {
|
||||
supported = append(supported, opt)
|
||||
}
|
||||
}
|
||||
}
|
||||
return supported
|
||||
|
||||
Reference in New Issue
Block a user