DNS: Avoid passing domain to WriteTo func (#6163)

https://github.com/XTLS/Xray-core/pull/6163#issuecomment-4528771758

---------

Co-authored-by: 风扇滑翔翼 <Fangliding.fshxy@outlook.com>
This commit is contained in:
Kirill Livanov
2026-05-28 21:27:08 +03:00
committed by GitHub
parent fa466f8174
commit cb206ddc74
2 changed files with 1 additions and 4 deletions
-4
View File
@@ -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 = &copyDest
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 = &copyDest
s.udpServer.Dispatch(toDnsContext(ctx, s.address.String()), *s.address, b)
}
}
+1
View File
@@ -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