mirror of
https://github.com/ZeroTier/ZeroTierOne
synced 2025-07-06 04:51:46 -07:00
Clean up handling of COMs, network access control, and fix a backward compatiblity issue.
This commit is contained in:
parent
1f6b13b7fd
commit
16df2c3363
8 changed files with 86 additions and 58 deletions
|
@ -154,6 +154,21 @@ public:
|
|||
return nconf.com.agreesWith(_com);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return True if this member has been on this network recently (or network is public)
|
||||
*/
|
||||
inline bool recentlyAllowedOnNetwork(const NetworkConfig &nconf) const
|
||||
{
|
||||
if (nconf.isPublic())
|
||||
return true;
|
||||
if (_com) {
|
||||
const uint64_t a = _com.timestamp().first;
|
||||
const std::pair<uint64_t,uint64_t> b(nconf.com.timestamp());
|
||||
return ((a <= b.first) ? ((b.first - a) <= ZT_PEER_ACTIVITY_TIMEOUT) : true);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether a capability or tag is within its max delta from the timestamp of our network config and newer than any blacklist cutoff time
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue