diff options
author | 2024-04-09 00:52:43 -0700 | |
---|---|---|
committer | 2024-04-09 09:52:43 +0200 | |
commit | 6706ee84199337304d8bbc10ad570e0e045b3132 (patch) | |
tree | f4310f7af18464b6af07607a7c72a80f57d68127 | |
parent | 4db719ae35b7d1136d84327ca599632badbffe1b (diff) | |
download | coredns-6706ee84199337304d8bbc10ad570e0e045b3132.tar.gz coredns-6706ee84199337304d8bbc10ad570e0e045b3132.tar.zst coredns-6706ee84199337304d8bbc10ad570e0e045b3132.zip |
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>
-rw-r--r-- | plugin/dns64/dns64.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/plugin/dns64/dns64.go b/plugin/dns64/dns64.go index 9f426eb87..0a6176fcf 100644 --- a/plugin/dns64/dns64.go +++ b/plugin/dns64/dns64.go @@ -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. |