mirror of
https://github.com/tailscale/tailscale.git
synced 2025-04-16 19:51:41 +00:00
net/dns/resolver: fix func used as netaddr.IP in printf
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
parent
d145c594ad
commit
064b916b1a
@ -322,16 +322,18 @@ func (f *forwarder) sendDoH(ctx context.Context, urlBase string, c *http.Client,
|
|||||||
// iOS and we want the number of pending DNS lookups to be bursty
|
// iOS and we want the number of pending DNS lookups to be bursty
|
||||||
// without too much associated goroutine/memory cost.
|
// without too much associated goroutine/memory cost.
|
||||||
func (f *forwarder) send(ctx context.Context, txidOut txid, closeOnCtxDone *closePool, packet []byte, dst netaddr.IPPort) ([]byte, error) {
|
func (f *forwarder) send(ctx context.Context, txidOut txid, closeOnCtxDone *closePool, packet []byte, dst netaddr.IPPort) ([]byte, error) {
|
||||||
|
ip := dst.IP()
|
||||||
|
|
||||||
// Upgrade known DNS IPs to DoH (DNS-over-HTTPs).
|
// Upgrade known DNS IPs to DoH (DNS-over-HTTPs).
|
||||||
if urlBase, dc, ok := f.getDoHClient(dst.IP()); ok {
|
if urlBase, dc, ok := f.getDoHClient(ip); ok {
|
||||||
res, err := f.sendDoH(ctx, urlBase, dc, packet)
|
res, err := f.sendDoH(ctx, urlBase, dc, packet)
|
||||||
if err == nil || ctx.Err() != nil {
|
if err == nil || ctx.Err() != nil {
|
||||||
return res, err
|
return res, err
|
||||||
}
|
}
|
||||||
f.logf("DoH error from %v: %v", dst.IP, err)
|
f.logf("DoH error from %v: %v", ip, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
ln, err := f.packetListener(dst.IP())
|
ln, err := f.packetListener(ip)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user