mirror of
https://github.com/coredns/coredns.git
synced 2025-11-24 20:54:02 -05:00
plugin/transfer: only allow outgoing axfr over tcp (#4452)
* plugin/transfer: only allow outgoing axfr over tcp Return refused when the query comes in over udp. No need to add a new test case as the current crop needed to be changed to use TCP. Fixes: #4450 Signed-off-by: Miek Gieben <miek@miek.nl> * transfer tests: this needs tcp as well Signed-off-by: Miek Gieben <miek@miek.nl>
This commit is contained in:
@@ -58,6 +58,10 @@ func (t *Transfer) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Ms
|
||||
return plugin.NextOrFailure(t.Name(), t.Next, ctx, w, r)
|
||||
}
|
||||
|
||||
if state.Proto() != "tcp" {
|
||||
return dns.RcodeRefused, nil
|
||||
}
|
||||
|
||||
x := longestMatch(t.xfrs, state.QName())
|
||||
if x == nil {
|
||||
return plugin.NextOrFailure(t.Name(), t.Next, ctx, w, r)
|
||||
|
||||
Reference in New Issue
Block a user