diff options
| author | Grant Limberg <glimberg@gmail.com> | 2016-09-05 16:19:10 -0700 |
|---|---|---|
| committer | Grant Limberg <glimberg@gmail.com> | 2016-09-05 16:19:10 -0700 |
| commit | 68a966fa5578a160fbd602cecf0e235b8df34e9f (patch) | |
| tree | a0633b825180feef8c74f24b005db1ec3f320af4 /node/Path.hpp | |
| parent | 43b3ec4b1afa3c3833f1f61ec10c9f22bd5e7359 (diff) | |
| parent | 3790ebe77a90cdaad629f275c2c4294694626733 (diff) | |
| download | infinitytier-68a966fa5578a160fbd602cecf0e235b8df34e9f.tar.gz infinitytier-68a966fa5578a160fbd602cecf0e235b8df34e9f.zip | |
Merge branch 'dev' of http://git.int.zerotier.com/ZeroTier/ZeroTierOne into dev
Diffstat (limited to 'node/Path.hpp')
| -rw-r--r-- | node/Path.hpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/node/Path.hpp b/node/Path.hpp index d0e1d737..718e1cdd 100644 --- a/node/Path.hpp +++ b/node/Path.hpp @@ -152,16 +152,10 @@ public: inline InetAddress::IpScope ipScope() const { return _ipScope; } /** - * @return Preference rank, higher == better (will be less than 255) + * @return Preference rank, higher == better */ inline unsigned int preferenceRank() const { - /* First, since the scope enum values in InetAddress.hpp are in order of - * use preference rank, we take that. Then we multiple by two, yielding - * a sequence like 0, 2, 4, 6, etc. Then if it's IPv6 we add one. This - * makes IPv6 addresses of a given scope outrank IPv4 addresses of the - * same scope -- e.g. 1 outranks 0. This makes us prefer IPv6, but not - * if the address scope/class is of a fundamentally lower rank. */ return ( ((unsigned int)_ipScope << 1) | (unsigned int)(_addr.ss_family == AF_INET6) ); } @@ -213,7 +207,7 @@ public: /** * @return True if this path needs a heartbeat */ - inline bool needsHeartbeat(const uint64_t now) const { return ((now - _lastOut) > ZT_PATH_HEARTBEAT_PERIOD); } + inline bool needsHeartbeat(const uint64_t now) const { return ((now - _lastOut) >= ZT_PATH_HEARTBEAT_PERIOD); } /** * @return Last time we sent something |
