mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-06 21:58:57 -04:00
only update peer IPs form discovery for non hidden nodes
This commit is contained in:
parent
abe3527635
commit
90a11a1236
1 changed files with 17 additions and 13 deletions
|
@ -373,26 +373,30 @@ void p3discovery2::recvOwnContactInfo(const RsPeerId &fromId, const RsDiscContac
|
||||||
}
|
}
|
||||||
|
|
||||||
// Peer Own Info replaces the existing info, because the
|
// Peer Own Info replaces the existing info, because the
|
||||||
// peer is the primary source of his own IPs.
|
// peer is the primary source of his own IPs, except for hidden nodes
|
||||||
|
// that normally send nothing. We still ignore it as a double security.
|
||||||
|
|
||||||
mPeerMgr->setNetworkMode(fromId, item->netMode);
|
mPeerMgr->setNetworkMode(fromId, item->netMode);
|
||||||
mPeerMgr->setLocation(fromId, item->location);
|
mPeerMgr->setLocation(fromId, item->location);
|
||||||
mPeerMgr->setVisState(fromId, item->vs_disc, item->vs_dht);
|
mPeerMgr->setVisState(fromId, item->vs_disc, item->vs_dht);
|
||||||
|
|
||||||
if(!det.localAddr.empty())
|
if(!mPeerMgr->isHiddenNode(fromId))
|
||||||
{
|
{
|
||||||
if(sockaddr_storage_isValidNet(item->localAddrV4.addr))
|
if(!det.localAddr.empty())
|
||||||
mPeerMgr->setLocalAddress(fromId,item->localAddrV4.addr);
|
{
|
||||||
else if(sockaddr_storage_isValidNet(item->localAddrV6.addr))
|
if(sockaddr_storage_isValidNet(item->localAddrV4.addr))
|
||||||
mPeerMgr->setLocalAddress(fromId,item->localAddrV6.addr);
|
mPeerMgr->setLocalAddress(fromId,item->localAddrV4.addr);
|
||||||
}
|
else if(sockaddr_storage_isValidNet(item->localAddrV6.addr))
|
||||||
|
mPeerMgr->setLocalAddress(fromId,item->localAddrV6.addr);
|
||||||
|
}
|
||||||
|
|
||||||
if(!det.extAddr.empty())
|
if(!det.extAddr.empty())
|
||||||
{
|
{
|
||||||
if(sockaddr_storage_isValidNet(item->extAddrV4.addr))
|
if(sockaddr_storage_isValidNet(item->extAddrV4.addr))
|
||||||
mPeerMgr->setExtAddress(fromId,item->extAddrV4.addr);
|
mPeerMgr->setExtAddress(fromId,item->extAddrV4.addr);
|
||||||
else if(sockaddr_storage_isValidNet(item->extAddrV6.addr))
|
else if(sockaddr_storage_isValidNet(item->extAddrV6.addr))
|
||||||
mPeerMgr->setExtAddress(fromId,item->extAddrV6.addr);
|
mPeerMgr->setExtAddress(fromId,item->extAddrV6.addr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setPeerVersion(fromId, item->version);
|
setPeerVersion(fromId, item->version);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue