mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-05 07:35:12 -04:00
switch from rsDht to rsBanList to decide on adding friend IP
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8328 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
db40002dda
commit
e65785e1bc
6 changed files with 109 additions and 92 deletions
|
@ -48,6 +48,7 @@ const int p3connectzone = 3431;
|
|||
#include "retroshare/rsiface.h"
|
||||
#include "retroshare/rspeers.h"
|
||||
#include "retroshare/rsdht.h"
|
||||
#include "retroshare/rsbanlist.h"
|
||||
|
||||
/* Network setup States */
|
||||
|
||||
|
@ -146,7 +147,7 @@ p3LinkMgrIMPL::p3LinkMgrIMPL(p3PeerMgrIMPL *peerMgr, p3NetMgrIMPL *netMgr)
|
|||
|
||||
struct sockaddr_storage bip;
|
||||
sockaddr_storage_clear(bip);
|
||||
struct sockaddr_in *addr = (struct sockaddr_in *) &bip;
|
||||
struct sockaddr_in *addr = (struct sockaddr_in *) &bip;
|
||||
addr->sin_family = AF_INET;
|
||||
addr->sin_addr.s_addr = 1;
|
||||
addr->sin_port = htons(0);
|
||||
|
@ -1726,10 +1727,7 @@ bool p3LinkMgrIMPL::locked_CheckPotentialAddr(const struct sockaddr_storage &ad
|
|||
return false;
|
||||
}
|
||||
|
||||
/* if it is on the ban list - ignore */
|
||||
/* checks - is it the dreaded 1.0.0.0 */
|
||||
|
||||
std::list<struct sockaddr_storage>::const_iterator it;
|
||||
std::list<struct sockaddr_storage>::const_iterator it;
|
||||
for(it = mBannedIpList.begin(); it != mBannedIpList.end(); ++it)
|
||||
{
|
||||
#ifdef LINKMGR_DEBUG
|
||||
|
@ -1746,14 +1744,13 @@ bool p3LinkMgrIMPL::locked_CheckPotentialAddr(const struct sockaddr_storage &ad
|
|||
}
|
||||
}
|
||||
|
||||
if(rsDht != NULL && rsDht->isAddressBanned(addr))
|
||||
if(rsBanList != NULL && !rsBanList->isAddressAccepted(addr, RSBANLIST_CHECKING_FLAGS_BLACKLIST))
|
||||
{
|
||||
#ifdef LINKMGR_DEBUG
|
||||
std::cerr << "p3LinkMgrIMPL::locked_CheckPotentialAddr() adding to local Banned IPList";
|
||||
std::cerr << std::endl;
|
||||
std::cerr << "p3LinkMgrIMPL::locked_CheckPotentialAddr() adding to local Banned IPList";
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
mBannedIpList.push_back(addr) ;
|
||||
return false ;
|
||||
return false ;
|
||||
}
|
||||
|
||||
/* if it is an external address, we'll accept it.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue