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:
electron128 2015-05-29 14:06:15 +00:00
parent 6b2cdaf9e1
commit 5f8755522e

View File

@ -219,8 +219,11 @@ bool p3BanList::isAddressAccepted(const sockaddr_storage &addr)
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)
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)
lst.push_back(it->second) ;
@ -509,11 +512,6 @@ int p3BanList::condenseBanSources_locked()
sockaddr_storage_copyip(bannedaddr, lit->second.addr);
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 */
std::map<struct sockaddr_storage, BanListPeer>::iterator sit;
sit = mBanSet.find(bannedaddr);