mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-28 00:07:09 -05:00
fix banlist (Patch from Cyril)
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8312 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
6b2cdaf9e1
commit
5f8755522e
@ -219,8 +219,11 @@ bool p3BanList::isAddressAccepted(const sockaddr_storage &addr)
|
|||||||
|
|
||||||
void p3BanList::getListOfBannedIps(std::list<BanListPeer> &lst)
|
void p3BanList::getListOfBannedIps(std::list<BanListPeer> &lst)
|
||||||
{
|
{
|
||||||
|
RS_STACK_MUTEX(mBanMtx) ;
|
||||||
|
|
||||||
for(std::map<sockaddr_storage,BanListPeer>::const_iterator it(mBanSet.begin());it!=mBanSet.end();++it)
|
for(std::map<sockaddr_storage,BanListPeer>::const_iterator it(mBanSet.begin());it!=mBanSet.end();++it)
|
||||||
lst.push_back(it->second) ;
|
if(mBanRanges.find(make24BitsRange(it->first)) == mBanRanges.end())
|
||||||
|
lst.push_back(it->second) ;
|
||||||
|
|
||||||
for(std::map<sockaddr_storage,BanListPeer>::const_iterator it(mBanRanges.begin());it!=mBanRanges.end();++it)
|
for(std::map<sockaddr_storage,BanListPeer>::const_iterator it(mBanRanges.begin());it!=mBanRanges.end();++it)
|
||||||
lst.push_back(it->second) ;
|
lst.push_back(it->second) ;
|
||||||
@ -509,11 +512,6 @@ int p3BanList::condenseBanSources_locked()
|
|||||||
sockaddr_storage_copyip(bannedaddr, lit->second.addr);
|
sockaddr_storage_copyip(bannedaddr, lit->second.addr);
|
||||||
sockaddr_storage_setport(bannedaddr, 0);
|
sockaddr_storage_setport(bannedaddr, 0);
|
||||||
|
|
||||||
// check if not already filtered in a Ban Range
|
|
||||||
|
|
||||||
if(mBanRanges.find(make24BitsRange(bannedaddr)) != mBanRanges.end())
|
|
||||||
continue ;
|
|
||||||
|
|
||||||
/* check if it exists in the Set already */
|
/* check if it exists in the Set already */
|
||||||
std::map<struct sockaddr_storage, BanListPeer>::iterator sit;
|
std::map<struct sockaddr_storage, BanListPeer>::iterator sit;
|
||||||
sit = mBanSet.find(bannedaddr);
|
sit = mBanSet.find(bannedaddr);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user