diff --git a/libretroshare/src/pqi/p3linkmgr.cc b/libretroshare/src/pqi/p3linkmgr.cc index 502400c09..01ba24e49 100644 --- a/libretroshare/src/pqi/p3linkmgr.cc +++ b/libretroshare/src/pqi/p3linkmgr.cc @@ -879,8 +879,12 @@ bool p3LinkMgrIMPL::connectResult(const std::string &id, bool success, uint32_t /* always switch it off now */ mNetMgr->netAssistFriend(id,false); - /* inform NetMgr that we know this peers address */ - mNetMgr->netAssistKnownPeer(id,remote_peer_address, NETASSIST_KNOWN_PEER_FRIEND | NETASSIST_KNOWN_PEER_ONLINE); + /* inform NetMgr that we know this peers address: but only if external address */ + if (isExternalNet(&(remote_peer_address.sin_addr))) + { + mNetMgr->netAssistKnownPeer(id,remote_peer_address, + NETASSIST_KNOWN_PEER_FRIEND | NETASSIST_KNOWN_PEER_ONLINE); + } } else { diff --git a/libretroshare/src/rsserver/rsinit.cc b/libretroshare/src/rsserver/rsinit.cc index 6c23d3266..3678d6845 100644 --- a/libretroshare/src/rsserver/rsinit.cc +++ b/libretroshare/src/rsserver/rsinit.cc @@ -2135,10 +2135,12 @@ int RsServer::StartupRetroShare() pqih -> addService(mBanList); mBitDht->setupPeerSharer(mBanList); +#ifdef RS_DSDVTEST p3Dsdv *mDsdv = new p3Dsdv(mLinkMgr); pqih -> addService(mDsdv); rsDsdv = mDsdv; mDsdv->addTestService(); +#endif #endif // MINIMAL_LIBRS diff --git a/libretroshare/src/services/p3banlist.cc b/libretroshare/src/services/p3banlist.cc index 0acde8696..32d1fa117 100644 --- a/libretroshare/src/services/p3banlist.cc +++ b/libretroshare/src/services/p3banlist.cc @@ -103,7 +103,8 @@ bool p3BanList::processIncoming() break; case RS_PKT_SUBTYPE_BANLIST_ITEM: { - updated = (updated || recvBanItem((RsBanListItem *) item)); + // Order is important!. + updated = (recvBanItem((RsBanListItem *) item) || updated); } break; } @@ -136,8 +137,9 @@ bool p3BanList::recvBanItem(RsBanListItem *item) std::list::const_iterator it; for(it = item->peerList.entries.begin(); it != item->peerList.entries.end(); it++) { - updated = (updated || addBanEntry(item->PeerId(), - it->addr, it->level, it->reason, it->age)); + // Order is important!. + updated = (addBanEntry(item->PeerId(), it->addr, it->level, + it->reason, it->age) || updated); } return updated; } @@ -173,6 +175,17 @@ bool p3BanList::addBanEntry(const std::string &peerId, const struct sockaddr_in std::cerr << std::endl; #endif + /* Only Accept it - if external address */ + if (!isExternalNet(&(addr.sin_addr))) + { +#ifdef DEBUG_BANLIST + std::cerr << "p3BanList::addBanEntry() Ignoring Non External Addr: " << rs_inet_ntoa(addr.sin_addr); + std::cerr << std::endl; +#endif + return false; + } + + std::map::iterator it; it = mBanSources.find(peerId); if (it == mBanSources.end())