Commit 12b304d9 authored by Miek Gieben's avatar Miek Gieben

Allow IXFR as well (#97)

parent ad221f4b
...@@ -16,13 +16,13 @@ type ( ...@@ -16,13 +16,13 @@ type (
} }
) )
// Serve an AXFR (or maybe later an IXFR) as well. // Serve an AXFR (and fallback of IXFR) as well.
func (x Xfr) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error) { func (x Xfr) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error) {
state := middleware.State{W: w, Req: r} state := middleware.State{W: w, Req: r}
if !x.TransferAllowed(state) { if !x.TransferAllowed(state) {
return dns.RcodeServerFailure, nil return dns.RcodeServerFailure, nil
} }
if state.QType() != dns.TypeAXFR { if state.QType() != dns.TypeAXFR && state.QType() != dns.TypeIXFR {
return 0, fmt.Errorf("xfr called with non transfer type: %d", state.QType()) return 0, fmt.Errorf("xfr called with non transfer type: %d", state.QType())
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment