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 committed by Nayla Hanegan
parent 52b4ac1613
commit 52eb84287e
No known key found for this signature in database
GPG key ID: 3075216CED0DB01D

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)
{