mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2026-01-12 00:05:50 +08:00
Added some more logging to the ctl around deauths
This commit is contained in:
@@ -511,9 +511,14 @@ void DB::_networkChanged(nlohmann::json& old, nlohmann::json& networkConfig, boo
|
||||
this->get(networkId, network, members);
|
||||
for (auto i = members.begin(); i != members.end(); ++i) {
|
||||
const std::string nodeID = (*i)["id"];
|
||||
fprintf(
|
||||
stderr, "Deauthorizing member %s on network %s due to network deletion\n", nodeID.c_str(),
|
||||
ids.c_str());
|
||||
const uint64_t memberId = Utils::hexStrToU64(nodeID.c_str());
|
||||
std::unique_lock<std::shared_mutex> ll(_changeListeners_l);
|
||||
for (auto j = _changeListeners.begin(); j != _changeListeners.end(); ++j) {
|
||||
fprintf(
|
||||
stderr, "Notifying listener of deauthorization of %s on %s\n", nodeID.c_str(), ids.c_str());
|
||||
(*j)->onNetworkMemberDeauthorize(this, networkId, memberId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1655,6 +1655,7 @@ void EmbeddedNetworkController::onNetworkMemberDeauthorize(const void* db, uint6
|
||||
auto span = tracer->StartSpan("embedded_controller::onNetworkMemberDeauthorize");
|
||||
auto scope = tracer->WithActiveSpan(span);
|
||||
|
||||
fprintf(stderr, "Member Deauthorized: nwid=%.16llx, nodeid=%.10llx\n", networkId, memberId);
|
||||
const int64_t now = OSUtils::now();
|
||||
Revocation rev(
|
||||
(uint32_t)_node->prng(), networkId, 0, now, ZT_REVOCATION_FLAG_FAST_PROPAGATE, Address(memberId),
|
||||
@@ -1663,8 +1664,13 @@ void EmbeddedNetworkController::onNetworkMemberDeauthorize(const void* db, uint6
|
||||
{
|
||||
std::lock_guard<std::mutex> l(_memberStatus_l);
|
||||
for (auto i = _memberStatus.begin(); i != _memberStatus.end(); ++i) {
|
||||
if ((i->first.networkId == networkId) && (i->second.online(now)))
|
||||
if ((i->first.networkId == networkId) && (i->second.online(now))) {
|
||||
_node->ncSendRevocation(Address(i->first.nodeId), rev);
|
||||
fprintf(stderr, " Sent revocation to %.10llx\n", i->first.nodeId);
|
||||
}
|
||||
else {
|
||||
fprintf(stderr, " Not sending revocation to %.10llx\n", i->first.nodeId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user