diff options
author | 2017-08-25 08:55:53 +0100 | |
---|---|---|
committer | 2017-08-25 08:55:53 +0100 | |
commit | 55dafe6f594781568a0060ee57f62858a77f3b21 (patch) | |
tree | 5684729cbbaea397084ada047d8e985425a1170d /middleware/file/file.go | |
parent | 932639ac9983a7b0cfaf9d0d967d8147f64b63ee (diff) | |
download | coredns-55dafe6f594781568a0060ee57f62858a77f3b21.tar.gz coredns-55dafe6f594781568a0060ee57f62858a77f3b21.tar.zst coredns-55dafe6f594781568a0060ee57f62858a77f3b21.zip |
core: block CH queries earlier (#973)
block chaos queries, unless the chaos or proxy middleware is loaded. We
respond with REFUSED.
This removes the need for each middleware to do this class != ClassINET
if-then.
Also make config.Registry non-public.
Diffstat (limited to 'middleware/file/file.go')
-rw-r--r-- | middleware/file/file.go | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/middleware/file/file.go b/middleware/file/file.go index 8a4cd27e2..27ab0cd1b 100644 --- a/middleware/file/file.go +++ b/middleware/file/file.go @@ -2,7 +2,6 @@ package file import ( - "errors" "fmt" "io" "log" @@ -32,9 +31,6 @@ type ( func (f File) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error) { state := request.Request{W: w, Req: r} - if state.QClass() != dns.ClassINET { - return dns.RcodeServerFailure, middleware.Error(f.Name(), errors.New("can only deal with ClassINET")) - } qname := state.Name() // TODO(miek): match the qname better in the map zone := middleware.Zones(f.Zones.Names).Matches(qname) |