mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 22:48:18 +00:00
fixed ban range check to make sure the whole ip matches and not just rely on the hash. Closes #946
This commit is contained in:
parent
a953fd5e3b
commit
8e293d0e63
|
@ -34,7 +34,7 @@ protected:
|
|||
|
||||
bool NetMatch(const CNetRange *pRange, const NETADDR *pAddr, int Start, int Length) const
|
||||
{
|
||||
return pRange->m_LB.type == pAddr->type &&
|
||||
return pRange->m_LB.type == pAddr->type && (Start == 0 || mem_comp(&pRange->m_LB.ip[0], &pAddr->ip[0], Start) == 0) &&
|
||||
mem_comp(&pRange->m_LB.ip[Start], &pAddr->ip[Start], Length-Start) <= 0 && mem_comp(&pRange->m_UB.ip[Start], &pAddr->ip[Start], Length-Start) >= 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue