diff --git a/libretroshare/src/pqi/p3linkmgr.cc b/libretroshare/src/pqi/p3linkmgr.cc index 1557b0498..c18030b75 100644 --- a/libretroshare/src/pqi/p3linkmgr.cc +++ b/libretroshare/src/pqi/p3linkmgr.cc @@ -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. diff --git a/libretroshare/src/pqi/pqisslpersongrp.cc b/libretroshare/src/pqi/pqisslpersongrp.cc index a0fdb6733..12f654fbd 100644 --- a/libretroshare/src/pqi/pqisslpersongrp.cc +++ b/libretroshare/src/pqi/pqisslpersongrp.cc @@ -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;