mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-05 03:53:44 +02:00
agree() must be called on our identity, the one with the secret
This commit is contained in:
parent
62a705af1c
commit
9284e4edfe
2 changed files with 3 additions and 3 deletions
|
@ -347,7 +347,7 @@ void Cluster::handleIncomingStateMessage(const void *msg,unsigned int len)
|
||||||
_RemotePeer &rp = _remotePeers[std::pair<Address,unsigned int>(id.address(),(unsigned int)fromMemberId)];
|
_RemotePeer &rp = _remotePeers[std::pair<Address,unsigned int>(id.address(),(unsigned int)fromMemberId)];
|
||||||
if (!rp.lastHavePeerReceived) {
|
if (!rp.lastHavePeerReceived) {
|
||||||
RR->topology->saveIdentity(id);
|
RR->topology->saveIdentity(id);
|
||||||
id.agree(RR->identity,rp.key,ZT_PEER_SECRET_KEY_LENGTH);
|
RR->identity.agree(id,rp.key,ZT_PEER_SECRET_KEY_LENGTH);
|
||||||
}
|
}
|
||||||
rp.lastHavePeerReceived = RR->node->now();
|
rp.lastHavePeerReceived = RR->node->now();
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,12 +82,12 @@ void Switch::onRemotePacket(const InetAddress &localAddr,const InetAddress &from
|
||||||
* no longer send these, but we'll listen for them for a while to
|
* no longer send these, but we'll listen for them for a while to
|
||||||
* locate peers with versions <1.0.4. */
|
* locate peers with versions <1.0.4. */
|
||||||
|
|
||||||
Address beaconAddr(reinterpret_cast<const char *>(data) + 8,5);
|
const Address beaconAddr(reinterpret_cast<const char *>(data) + 8,5);
|
||||||
if (beaconAddr == RR->identity.address())
|
if (beaconAddr == RR->identity.address())
|
||||||
return;
|
return;
|
||||||
if (!RR->node->shouldUsePathForZeroTierTraffic(beaconAddr,localAddr,fromAddr))
|
if (!RR->node->shouldUsePathForZeroTierTraffic(beaconAddr,localAddr,fromAddr))
|
||||||
return;
|
return;
|
||||||
SharedPtr<Peer> peer(RR->topology->getPeer(beaconAddr));
|
const SharedPtr<Peer> peer(RR->topology->getPeer(beaconAddr));
|
||||||
if (peer) { // we'll only respond to beacons from known peers
|
if (peer) { // we'll only respond to beacons from known peers
|
||||||
if ((now - _lastBeaconResponse) >= 2500) { // limit rate of responses
|
if ((now - _lastBeaconResponse) >= 2500) { // limit rate of responses
|
||||||
_lastBeaconResponse = now;
|
_lastBeaconResponse = now;
|
||||||
|
|
Loading…
Add table
Reference in a new issue