Skip to content

Commit 6e35cf9

Browse files
committed
fix: truncated UDP response in system dns
#2031
1 parent 2116640 commit 6e35cf9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

dns/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func (c *client) ExchangeContext(ctx context.Context, m *D.Msg) (*D.Msg, error)
7777
msg, _, err := c.Client.ExchangeWithConn(m, dConn)
7878

7979
// Resolvers MUST resend queries over TCP if they receive a truncated UDP response (with TC=1 set)!
80-
if msg != nil && msg.Truncated && c.Client.Net == "" {
80+
if msg != nil && msg.Truncated && network == "udp" {
8181
tcpClient := *c.Client // copy a client
8282
tcpClient.Net = "tcp"
8383
network = "tcp"

0 commit comments

Comments
 (0)