mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2024-12-22 22:32:22 +00:00
Send last requets time in status, and do not set physicalAddr unless we know one.
This commit is contained in:
parent
bcc6799902
commit
faf7b81c01
@ -1059,11 +1059,11 @@ unsigned int EmbeddedNetworkController::handleControlPlaneHttpPOST(
|
|||||||
_db.eachId([this,&pong,&now,&first](uint64_t networkId,uint64_t nodeId) {
|
_db.eachId([this,&pong,&now,&first](uint64_t networkId,uint64_t nodeId) {
|
||||||
char tmp[64];
|
char tmp[64];
|
||||||
auto ms = this->_memberStatus.find(_MemberStatusKey(networkId,nodeId));
|
auto ms = this->_memberStatus.find(_MemberStatusKey(networkId,nodeId));
|
||||||
Utils::snprintf(tmp,sizeof(tmp),"%s\"%.16llx-%.10llx\":%s",
|
Utils::snprintf(tmp,sizeof(tmp),"%s\"%.16llx-%.10llx\":%llu",
|
||||||
(first) ? "" : ",",
|
(first) ? "" : ",",
|
||||||
(unsigned long long)networkId,
|
(unsigned long long)networkId,
|
||||||
(unsigned long long)nodeId,
|
(unsigned long long)nodeId,
|
||||||
((ms != _memberStatus.end())&&(ms->second.online(now))) ? "true" : "false");
|
(ms != _memberStatus.end()) ? (unsigned long long)ms->second.lastRequestTime : 0ULL);
|
||||||
pong.append(tmp);
|
pong.append(tmp);
|
||||||
first = false;
|
first = false;
|
||||||
});
|
});
|
||||||
@ -1385,6 +1385,7 @@ void EmbeddedNetworkController::_request(
|
|||||||
|
|
||||||
if (fromAddr)
|
if (fromAddr)
|
||||||
ms.physicalAddr = fromAddr;
|
ms.physicalAddr = fromAddr;
|
||||||
|
if (ms.physicalAddr)
|
||||||
member["physicalAddr"] = ms.physicalAddr.toString();
|
member["physicalAddr"] = ms.physicalAddr.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user