Skip to content

Commit 7c25453

Browse files
authored
Merge pull request #21 from Bamcane/pr-broadcast-packet-token-fix
Fix incorrect reuse of the same NetToken for broadcast packets
2 parents b432e2e + 579be1b commit 7c25453

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/engine/shared/network_token.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ void CNetTokenCache::AddToken(const NETADDR *pAddr, TOKEN Token, int TokenFLag)
263263
{
264264
NETADDR NullAddr = { 0 };
265265
NullAddr.type = 7; // cover broadcasts
266-
if(net_addr_comp(&pInfo->m_Addr, pAddr, true) == 0 || ((TokenFLag&NET_TOKENFLAG_ALLOWBROADCAST) && net_addr_comp(&pInfo->m_Addr, &NullAddr, false) == 0))
266+
if(net_addr_comp(&pInfo->m_Addr, pAddr, true) == 0 || ((TokenFLag&NET_TOKENFLAG_ALLOWBROADCAST) && net_addr_comp(&pInfo->m_Addr, &NullAddr, false) == 0 && pInfo->m_Addr.port == pAddr->port))
267267
{
268268
// notify the user that the packet gets delivered
269269
if(pInfo->m_pfnCallback)

0 commit comments

Comments
 (0)