From 9026a4a295efa216f79e80dd7c544fcf0001ed27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Benkovsk=C3=BD?= Date: Thu, 26 Aug 2021 09:39:44 -0700 Subject: [PATCH] upstream lookups are done with original EDNS options (#4826) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * upstream lookups are done with original EDNS options Signed-off-by: Ondřej Benkovský * fixup! upstream lookups are done with original EDNS options Signed-off-by: Ondřej Benkovský --- plugin/pkg/upstream/upstream.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/plugin/pkg/upstream/upstream.go b/plugin/pkg/upstream/upstream.go index 9c2973e41..f789d6692 100644 --- a/plugin/pkg/upstream/upstream.go +++ b/plugin/pkg/upstream/upstream.go @@ -24,15 +24,10 @@ func (u *Upstream) Lookup(ctx context.Context, state request.Request, name strin if !ok { return nil, fmt.Errorf("no full server is running") } - - size := state.Size() - do := state.Do() - req := new(dns.Msg) - req.SetQuestion(name, typ) - req.SetEdns0(uint16(size), do) + req := state.NewWithQuestion(name, typ) nw := nonwriter.New(state.W) - server.ServeDNS(ctx, nw, req) + server.ServeDNS(ctx, nw, req.Req) return nw.Msg, nil }