mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-12 20:28:27 +00:00
(1) distribute default root-topology in new dictionary format, (2) bump peer serialization version to force obsolescence of old supernodes, (3) stop outputting a log message every time we poll for software updates
This commit is contained in:
@ -466,7 +466,6 @@ Node::ReasonForTermination Node::run()
|
||||
#endif
|
||||
}
|
||||
|
||||
// Load or generate config authentication secret
|
||||
std::string configAuthTokenPath(_r->homePath + ZT_PATH_SEPARATOR_S + "authtoken.secret");
|
||||
std::string configAuthToken;
|
||||
if (!Utils::readFile(configAuthTokenPath.c_str(),configAuthToken)) {
|
||||
@ -501,8 +500,19 @@ Node::ReasonForTermination Node::run()
|
||||
}
|
||||
#endif
|
||||
|
||||
// Set initial supernode list
|
||||
_r->topology->setSupernodes(ZT_DEFAULTS.supernodes);
|
||||
std::string rootTopologyPath(_r->homePath + ZT_PATH_SEPARATOR_S + "root-topology");
|
||||
std::string rootTopology;
|
||||
if (!Utils::readFile(rootTopologyPath.c_str(),rootTopology))
|
||||
rootTopology = ZT_DEFAULTS.defaultRootTopology;
|
||||
try {
|
||||
Dictionary rt(rootTopology);
|
||||
if (!Topology::authenticateRootTopology(rt))
|
||||
return impl->terminateBecause(Node::NODE_UNRECOVERABLE_ERROR,"root-topology failed signature verification check");
|
||||
Dictionary supernodes(rt.get("supernodes"));
|
||||
_r->topology->setSupernodes(supernodes);
|
||||
} catch ( ... ) {
|
||||
return impl->terminateBecause(Node::NODE_UNRECOVERABLE_ERROR,"invalid root-topology format");
|
||||
}
|
||||
} catch (std::bad_alloc &exc) {
|
||||
return impl->terminateBecause(Node::NODE_UNRECOVERABLE_ERROR,"memory allocation failure");
|
||||
} catch (std::runtime_error &exc) {
|
||||
|
Reference in New Issue
Block a user