Fixed a bug where in the extremely unlikely change that HostIDs collide, a new HostID is generated.

This commit is contained in:
Upfoldian 2023-07-13 21:33:36 +10:00
parent 7f40c6f2f8
commit c4978edaf6
1 changed files with 1 additions and 1 deletions

View File

@ -312,9 +312,9 @@ static void HandlePacket(Common::TraversalPacket* packet, sockaddr_in6* addr)
Common::TraversalInetAddress* iaddr{};
// not that there is any significant change of
// duplication, but...
GetRandomHostId(&hostId);
while (true)
{
GetRandomHostId(&hostId);
auto r = EvictFind(connectedClients, hostId);
if (!r.found)
{