From f0acebf56dc257fb5d6604c9b4b82191529bfd5a Mon Sep 17 00:00:00 2001 From: gVisor bot Date: Mon, 4 Jan 2021 00:51:53 +0800 Subject: [PATCH] Fix: dns client should not bind local address --- dns/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dns/client.go b/dns/client.go index a40888ddd..151bee24a 100644 --- a/dns/client.go +++ b/dns/client.go @@ -39,7 +39,7 @@ func (c *client) ExchangeContext(ctx context.Context, m *D.Msg) (msg *D.Msg, err return nil, err } - if dialer.DialHook != nil { + if ip != nil && ip.IsGlobalUnicast() && dialer.DialHook != nil { network := "udp" if strings.HasPrefix(c.Client.Net, "tcp") { network = "tcp"