mirror of
https://github.com/coredns/coredns.git
synced 2025-10-27 08:14:18 -04:00
Return RcodeServerFailure when DNS64 has no next plugin (#6590)
If using a coredns config with only the dns64 plugin specified, the `Next` plugin that dns64 will attempt to call will be nil, resulting in a nil pointer dereference. We should return an error instead of crashing. Signed-off-by: Jared Baur <jaredbaur@fastmail.com>
This commit is contained in:
@@ -36,7 +36,7 @@ type DNS64 struct {
|
||||
func (d *DNS64) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error) {
|
||||
// Don't proxy if we don't need to.
|
||||
if !d.requestShouldIntercept(&request.Request{W: w, Req: r}) {
|
||||
return d.Next.ServeDNS(ctx, w, r)
|
||||
return plugin.NextOrFailure(d.Name(), d.Next, ctx, w, r)
|
||||
}
|
||||
|
||||
// Pass the request to the next plugin in the chain, but intercept the response.
|
||||
|
||||
Reference in New Issue
Block a user