Clean up handling of COMs, network access control, and fix a backward compatiblity issue.
This commit is contained in:
@@ -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
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user