make sure that own IP reported by friend is a valid external IP. When connected on LAN, that is not the case.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8361 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2015-06-03 21:02:59 +00:00
parent ad13962e1f
commit 00921b969e
2 changed files with 5 additions and 4 deletions

View File

@ -333,7 +333,7 @@ bool p3BanList::isAddressAccepted(const sockaddr_storage &addr, uint32_t checkin
{
++it->second.connect_attempts;
//#ifdef DEBUG_BANLIST
std::cerr << "found in blacklisted range " << sockaddr_storage_iptostring(it->first) << "/24. returning false. attempts=" << it->second.connect_attempts << std::endl;
std::cerr << " found in blacklisted range " << sockaddr_storage_iptostring(it->first) << "/24. returning false. attempts=" << it->second.connect_attempts << std::endl;
//#endif
if(check_result != NULL)
*check_result = RSBANLIST_CHECK_RESULT_BLACKLISTED ;
@ -344,7 +344,7 @@ bool p3BanList::isAddressAccepted(const sockaddr_storage &addr, uint32_t checkin
{
++it->second.connect_attempts;
//#ifdef DEBUG_BANLIST
std::cerr << "found in blacklisted range " << sockaddr_storage_iptostring(it->first) << "/32. returning false. attempts=" << it->second.connect_attempts << std::endl;
std::cerr << " found in blacklisted range " << sockaddr_storage_iptostring(it->first) << "/32. returning false. attempts=" << it->second.connect_attempts << std::endl;
//#endif
if(check_result != NULL)
*check_result = RSBANLIST_CHECK_RESULT_BLACKLISTED ;

View File

@ -849,8 +849,9 @@ void p3discovery2::processContactInfo(const SSLID &fromId, const RsDiscContactIt
RsStackMutex stack(mDiscMtx); /********** STACK LOCKED MTX ******/
if (item->sslId == rsPeers->getOwnId())
{
mPeerMgr->addCandidateForOwnExternalAddress(item->PeerId(), item->extAddrV4.addr) ;
{
if(sockaddr_storage_isExternalNet(item->extAddrV4.addr))
mPeerMgr->addCandidateForOwnExternalAddress(item->PeerId(), item->extAddrV4.addr) ;
#ifdef P3DISC_DEBUG
std::cerr << "p3discovery2::processContactInfo(" << fromId << ") PGPID: ";
std::cerr << item->pgpId << " Ignoring Info on self";