mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-17 14:48:17 +00:00
--wtf; prevent roots from TCP fallback
This commit is contained in:
@ -321,8 +321,8 @@ ZT_ResultCode Node::processBackgroundTasks(uint64_t now,volatile uint64_t *nextB
|
|||||||
RR->topology->eachPeer<_PingPeersThatNeedPing &>(pfunc);
|
RR->topology->eachPeer<_PingPeersThatNeedPing &>(pfunc);
|
||||||
|
|
||||||
// Update online status, post status change as event
|
// Update online status, post status change as event
|
||||||
bool oldOnline = _online;
|
const bool oldOnline = _online;
|
||||||
_online = ((now - pfunc.lastReceiveFromUpstream) < ZT_PEER_ACTIVITY_TIMEOUT);
|
_online = (((now - pfunc.lastReceiveFromUpstream) < ZT_PEER_ACTIVITY_TIMEOUT)||(RR->topology->amRoot()));
|
||||||
if (oldOnline != _online)
|
if (oldOnline != _online)
|
||||||
postEvent(_online ? ZT_EVENT_ONLINE : ZT_EVENT_OFFLINE);
|
postEvent(_online ? ZT_EVENT_ONLINE : ZT_EVENT_OFFLINE);
|
||||||
} catch ( ... ) {
|
} catch ( ... ) {
|
||||||
|
@ -867,6 +867,7 @@ public:
|
|||||||
{
|
{
|
||||||
#ifdef ZT_ENABLE_CLUSTER
|
#ifdef ZT_ENABLE_CLUSTER
|
||||||
if (sock == _clusterMessageSocket) {
|
if (sock == _clusterMessageSocket) {
|
||||||
|
_lastDirectReceiveFromGlobal = OSUtils::now();
|
||||||
_node->clusterHandleIncomingMessage(data,len);
|
_node->clusterHandleIncomingMessage(data,len);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1030,7 +1031,7 @@ public:
|
|||||||
if (from) {
|
if (from) {
|
||||||
ZT_ResultCode rc = _node->processWirePacket(
|
ZT_ResultCode rc = _node->processWirePacket(
|
||||||
OSUtils::now(),
|
OSUtils::now(),
|
||||||
0,
|
&ZT_SOCKADDR_NULL,
|
||||||
reinterpret_cast<struct sockaddr_storage *>(&from),
|
reinterpret_cast<struct sockaddr_storage *>(&from),
|
||||||
data,
|
data,
|
||||||
plen,
|
plen,
|
||||||
|
Reference in New Issue
Block a user