diff options
| author | Grant Limberg <glimberg@gmail.com> | 2016-09-08 17:45:46 -0700 |
|---|---|---|
| committer | Grant Limberg <glimberg@gmail.com> | 2016-09-08 17:45:46 -0700 |
| commit | 5ed5b22525b9233871e3fca8da2c9d77535afd7b (patch) | |
| tree | 0c39ab15dd1a9456a204e69e8d51eaaed2e8944d /node/SelfAwareness.cpp | |
| parent | dccca7df1a893dacc50a605d707917f579d05db9 (diff) | |
| parent | 8afdb0aa651fcad00d4eaa0d09d5b4d40bbfb864 (diff) | |
| download | infinitytier-5ed5b22525b9233871e3fca8da2c9d77535afd7b.tar.gz infinitytier-5ed5b22525b9233871e3fca8da2c9d77535afd7b.zip | |
Merge branch 'dev' of http://git.int.zerotier.com/ZeroTier/ZeroTierOne into dev
Diffstat (limited to 'node/SelfAwareness.cpp')
| -rw-r--r-- | node/SelfAwareness.cpp | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/node/SelfAwareness.cpp b/node/SelfAwareness.cpp index b9ab9d67..6bf50720 100644 --- a/node/SelfAwareness.cpp +++ b/node/SelfAwareness.cpp @@ -33,37 +33,31 @@ #include "Switch.hpp" // Entry timeout -- make it fairly long since this is just to prevent stale buildup -#define ZT_SELFAWARENESS_ENTRY_TIMEOUT 3600000 +#define ZT_SELFAWARENESS_ENTRY_TIMEOUT 600000 namespace ZeroTier { class _ResetWithinScope { public: - _ResetWithinScope(uint64_t now,InetAddress::IpScope scope) : + _ResetWithinScope(uint64_t now,int inetAddressFamily,InetAddress::IpScope scope) : _now(now), + _family(inetAddressFamily), _scope(scope) {} - inline void operator()(Topology &t,const SharedPtr<Peer> &p) - { - if (p->resetWithinScope(_scope,_now)) - peersReset.push_back(p); - } + inline void operator()(Topology &t,const SharedPtr<Peer> &p) { if (p->resetWithinScope(_scope,_family,_now)) peersReset.push_back(p); } std::vector< SharedPtr<Peer> > peersReset; private: uint64_t _now; + int _family; InetAddress::IpScope _scope; }; SelfAwareness::SelfAwareness(const RuntimeEnvironment *renv) : RR(renv), - _phy(32) -{ -} - -SelfAwareness::~SelfAwareness() + _phy(128) { } @@ -98,8 +92,8 @@ void SelfAwareness::iam(const Address &reporter,const InetAddress &receivedOnLoc } } - // Reset all paths within this scope - _ResetWithinScope rset(now,(InetAddress::IpScope)scope); + // Reset all paths within this scope and address family + _ResetWithinScope rset(now,myPhysicalAddress.ss_family,(InetAddress::IpScope)scope); RR->topology->eachPeer<_ResetWithinScope &>(rset); // Send a NOP to all peers for whom we forgot a path. This will cause direct |
