summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--node/Node.cpp4
-rw-r--r--service/OneService.cpp3
2 files changed, 4 insertions, 3 deletions
diff --git a/node/Node.cpp b/node/Node.cpp
index 2b298903..87871e20 100644
--- a/node/Node.cpp
+++ b/node/Node.cpp
@@ -321,8 +321,8 @@ ZT_ResultCode Node::processBackgroundTasks(uint64_t now,volatile uint64_t *nextB
RR->topology->eachPeer<_PingPeersThatNeedPing &>(pfunc);
// Update online status, post status change as event
- bool oldOnline = _online;
- _online = ((now - pfunc.lastReceiveFromUpstream) < ZT_PEER_ACTIVITY_TIMEOUT);
+ const bool oldOnline = _online;
+ _online = (((now - pfunc.lastReceiveFromUpstream) < ZT_PEER_ACTIVITY_TIMEOUT)||(RR->topology->amRoot()));
if (oldOnline != _online)
postEvent(_online ? ZT_EVENT_ONLINE : ZT_EVENT_OFFLINE);
} catch ( ... ) {
diff --git a/service/OneService.cpp b/service/OneService.cpp
index 729812ed..7a473b67 100644
--- a/service/OneService.cpp
+++ b/service/OneService.cpp
@@ -867,6 +867,7 @@ public:
{
#ifdef ZT_ENABLE_CLUSTER
if (sock == _clusterMessageSocket) {
+ _lastDirectReceiveFromGlobal = OSUtils::now();
_node->clusterHandleIncomingMessage(data,len);
return;
}
@@ -1030,7 +1031,7 @@ public:
if (from) {
ZT_ResultCode rc = _node->processWirePacket(
OSUtils::now(),
- 0,
+ &ZT_SOCKADDR_NULL,
reinterpret_cast<struct sockaddr_storage *>(&from),
data,
plen,