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>
This commit is contained in:
Ondřej Benkovský
2021-08-26 09:39:44 -07:00
committed by GitHub
parent 44c82602e1
commit 9026a4a295

View File

@@ -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
}