diff options
| author | Grant Limberg <glimberg@gmail.com> | 2016-09-18 18:10:03 -0700 |
|---|---|---|
| committer | Grant Limberg <glimberg@gmail.com> | 2016-09-18 18:10:03 -0700 |
| commit | 3366b53247adca547055300a573fd91182e2255c (patch) | |
| tree | 7fc29673601151750fc6b19a9a06d287e70eaa3b /node/Membership.hpp | |
| parent | 5ed5b22525b9233871e3fca8da2c9d77535afd7b (diff) | |
| parent | 68e549233ddba17ec686a0462e2630580ee3d2a7 (diff) | |
| download | infinitytier-3366b53247adca547055300a573fd91182e2255c.tar.gz infinitytier-3366b53247adca547055300a573fd91182e2255c.zip | |
Merge branch 'dev' of http://git.int.zerotier.com/ZeroTier/ZeroTierOne into dev
Diffstat (limited to 'node/Membership.hpp')
| -rw-r--r-- | node/Membership.hpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/node/Membership.hpp b/node/Membership.hpp index 22910148..d67c6822 100644 --- a/node/Membership.hpp +++ b/node/Membership.hpp @@ -155,6 +155,23 @@ public: } /** + * @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; + if ((_blacklistBefore)&&(a <= _blacklistBefore)) + return false; + const uint64_t b = nconf.com.timestamp().first; + return ((a <= b) ? ((b - a) <= ZT_NETWORKCONFIG_DEFAULT_CREDENTIAL_TIME_MAX_MAX_DELTA) : 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 * * @param cred Credential to check -- must have timestamp() accessor method |
