Tweaked linkmgr to allow loopback connections.

This allows STD -> HIDDEN connections!



git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.6-initdev@7037 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
drbob 2014-01-19 06:25:49 +00:00
parent d39c5c028a
commit 6526dd6c4b
2 changed files with 15 additions and 2 deletions

View File

@ -1709,7 +1709,7 @@ bool p3LinkMgrIMPL::locked_CheckPotentialAddr(const struct sockaddr_storage &ad
}
bool isValid = sockaddr_storage_isValidNet(addr);
// bool isLoopback = sockaddr_storage_isLoopbackNet(addr);
bool isLoopback = sockaddr_storage_isLoopbackNet(addr);
// bool isPrivate = sockaddr_storage_isPrivateNet(addr);
bool isExternal = sockaddr_storage_isExternalNet(addr);
@ -1753,6 +1753,18 @@ bool p3LinkMgrIMPL::locked_CheckPotentialAddr(const struct sockaddr_storage &ad
}
/* if loopback, then okay - probably proxy connection (or local testing).
*/
if (isLoopback)
{
#ifdef LINKMGR_DEBUG
std::cerr << "p3LinkMgrIMPL::locked_CheckPotentialAddr() ACCEPTING - LOOPBACK";
std::cerr << std::endl;
#endif
return true;
}
/* get here, it is private or loopback
* - can only connect to these addresses if we are on the same subnet.
- check net against our local address.

View File

@ -76,7 +76,8 @@ pqiperson * pqisslpersongrp::locked_createPerson(std::string id, pqilistener *li
pqiperson *pqip = new pqiperson(id, this);
// If using proxy, then only create a proxy item, otherwise can use any.
if (mPeerMgr->isHiddenPeer(id))
// If we are a hidden node - then all connections should be via proxy.
if (mPeerMgr->isHiddenPeer(id) || mPeerMgr->isHidden())
{
std::cerr << "pqisslpersongrp::locked_createPerson() Is Hidden Peer!";
std::cerr << std::endl;