Merge pull request #205 from eeeee/bans_fix

hacky bans fix
This commit is contained in:
Dennis Felsing 2015-05-16 03:37:56 +02:00
commit f278773318

View file

@ -406,8 +406,15 @@ int CNetBan::UnbanByIndex(int Index)
return Result; return Result;
} }
bool CNetBan::IsBanned(const NETADDR *pAddr, char *pBuf, unsigned BufferSize) const bool CNetBan::IsBanned(const NETADDR *pOrigAddr, char *pBuf, unsigned BufferSize) const
{ {
NETADDR addr;
NETADDR *pAddr = pOrigAddr;
if (pOrigAddr->type == NETTYPE_WEBSOCKET_IPV4) {
mem_copy(&addr, pOrigAddr, sizeof(NETADDR));
pAddr = &addr;
addr.type = NETTYPE_IPV4;
}
CNetHash aHash[17]; CNetHash aHash[17];
int Length = CNetHash::MakeHashArray(pAddr, aHash); int Length = CNetHash::MakeHashArray(pAddr, aHash);