diff --git a/app/dns/nameserver_udp.go b/app/dns/nameserver_udp.go index 55b825f7..e75f301a 100644 --- a/app/dns/nameserver_udp.go +++ b/app/dns/nameserver_udp.go @@ -131,8 +131,6 @@ func (s *ClassicNameServer) HandleResponse(ctx context.Context, packet *udp_prot newReq.msg = &newMsg s.addPendingRequest(&newReq) b, _ := dns.PackMessage(newReq.msg) - copyDest := net.UDPDestination(s.address.Address, s.address.Port) - b.UDP = ©Dest s.udpServer.Dispatch(toDnsContext(newReq.ctx, s.address.String()), *s.address, b) return } @@ -179,8 +177,6 @@ func (s *ClassicNameServer) sendQuery(ctx context.Context, noResponseErrCh chan< } return } - copyDest := net.UDPDestination(s.address.Address, s.address.Port) - b.UDP = ©Dest s.udpServer.Dispatch(toDnsContext(ctx, s.address.String()), *s.address, b) } } diff --git a/proxy/wireguard/client.go b/proxy/wireguard/client.go index 3ee3a2c5..8a02d89f 100644 --- a/proxy/wireguard/client.go +++ b/proxy/wireguard/client.go @@ -185,6 +185,7 @@ func (h *Handler) Process(ctx context.Context, link *transport.Link, dialer inte } addr = net.IPAddress(ips[dice.Roll(len(ips))]) } + destination.Address = addr var newCtx context.Context var newCancel context.CancelFunc