Skip to content

Commit

Permalink
Fix: dns client should not bind local address
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamacro committed Jan 3, 2021
1 parent 9619c3f commit 6fedd7e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dns/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 6fedd7e

Please sign in to comment.