aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Ondřej Benkovský <ondrej.benkovsky@jamf.com> 2021-08-26 09:39:44 -0700
committerGravatar GitHub <noreply@github.com> 2021-08-26 09:39:44 -0700
commit9026a4a295efa216f79e80dd7c544fcf0001ed27 (patch)
treedcef8a4d8a8691d29969abfd11db410f6746fd7a
parent44c82602e12d7da2a9ab9f86c3a0342f7fb5e890 (diff)
downloadcoredns-9026a4a295efa216f79e80dd7c544fcf0001ed27.tar.gz
coredns-9026a4a295efa216f79e80dd7c544fcf0001ed27.tar.zst
coredns-9026a4a295efa216f79e80dd7c544fcf0001ed27.zip
upstream lookups are done with original EDNS options (#4826)
* upstream lookups are done with original EDNS options Signed-off-by: Ondřej Benkovský <ondrej.benkovsky@jamf.com> * fixup! upstream lookups are done with original EDNS options Signed-off-by: Ondřej Benkovský <ondrej.benkovsky@jamf.com>
-rw-r--r--plugin/pkg/upstream/upstream.go9
1 files 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
}