Skip to content

Commit cb206dd

Browse files
DNS: Avoid passing domain to WriteTo func (#6163)
#6163 (comment) --------- Co-authored-by: 风扇滑翔翼 <Fangliding.fshxy@outlook.com>
1 parent fa466f8 commit cb206dd

2 files changed

Lines changed: 1 addition & 4 deletions

File tree

app/dns/nameserver_udp.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,6 @@ func (s *ClassicNameServer) HandleResponse(ctx context.Context, packet *udp_prot
131131
newReq.msg = &newMsg
132132
s.addPendingRequest(&newReq)
133133
b, _ := dns.PackMessage(newReq.msg)
134-
copyDest := net.UDPDestination(s.address.Address, s.address.Port)
135-
b.UDP = &copyDest
136134
s.udpServer.Dispatch(toDnsContext(newReq.ctx, s.address.String()), *s.address, b)
137135
return
138136
}
@@ -179,8 +177,6 @@ func (s *ClassicNameServer) sendQuery(ctx context.Context, noResponseErrCh chan<
179177
}
180178
return
181179
}
182-
copyDest := net.UDPDestination(s.address.Address, s.address.Port)
183-
b.UDP = &copyDest
184180
s.udpServer.Dispatch(toDnsContext(ctx, s.address.String()), *s.address, b)
185181
}
186182
}

proxy/wireguard/client.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ func (h *Handler) Process(ctx context.Context, link *transport.Link, dialer inte
185185
}
186186
addr = net.IPAddress(ips[dice.Roll(len(ips))])
187187
}
188+
destination.Address = addr
188189

189190
var newCtx context.Context
190191
var newCancel context.CancelFunc

0 commit comments

Comments
 (0)