From 3443b203e4035104071f5af0143591dcd48a4974 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Tue, 1 Oct 2013 16:01:36 -0400 Subject: Each peer now tracks the last time it announced multicast LIKEs independently and does so frequently enough to prevent expires. Also add a multicast debug facility for use on the testnet. --- node/Peer.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'node/Peer.cpp') diff --git a/node/Peer.cpp b/node/Peer.cpp index 1d22fd1f..1c7eec34 100644 --- a/node/Peer.cpp +++ b/node/Peer.cpp @@ -26,6 +26,7 @@ */ #include "Peer.hpp" +#include "Switch.hpp" namespace ZeroTier { @@ -66,6 +67,12 @@ void Peer::onReceive(const RuntimeEnvironment *_r,Demarc::Port localPort,const I wp->localPort = localPort; if (!wp->fixed) wp->addr = remoteAddr; + + if ((now - _lastAnnouncedTo) >= ((ZT_MULTICAST_LIKE_EXPIRE / 2) - 1000)) { + _lastAnnouncedTo = now; + _r->sw->announceMulticastGroups(SharedPtr(this)); + } + _dirty = true; } -- cgit v1.2.3