mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-02-22 10:20:52 +00:00
Don't need to announce on multicast leave.
This commit is contained in:
parent
51f46a009a
commit
6807ccd710
@ -147,24 +147,15 @@ void Network::multicastSubscribe(const MulticastGroup &mg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Network::multicastUnsubscribe(const MulticastGroup &mg)
|
void Network::multicastUnsubscribe(const MulticastGroup &mg)
|
||||||
{
|
|
||||||
bool needAnnounce = false;
|
|
||||||
{
|
{
|
||||||
Mutex::Lock _l(_lock);
|
Mutex::Lock _l(_lock);
|
||||||
|
|
||||||
std::vector<MulticastGroup> nmg;
|
std::vector<MulticastGroup> nmg;
|
||||||
for(std::vector<MulticastGroup>::const_iterator i(_myMulticastGroups.begin());i!=_myMulticastGroups.end();++i) {
|
for(std::vector<MulticastGroup>::const_iterator i(_myMulticastGroups.begin());i!=_myMulticastGroups.end();++i) {
|
||||||
if (*i != mg)
|
if (*i != mg)
|
||||||
nmg.push_back(*i);
|
nmg.push_back(*i);
|
||||||
}
|
}
|
||||||
|
if (nmg.size() != _myMulticastGroups.size())
|
||||||
if (nmg.size() != _myMulticastGroups.size()) {
|
|
||||||
_myMulticastGroups.swap(nmg);
|
_myMulticastGroups.swap(nmg);
|
||||||
needAnnounce = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (needAnnounce)
|
|
||||||
_announceMulticastGroups();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Network::applyConfiguration(const SharedPtr<NetworkConfig> &conf)
|
bool Network::applyConfiguration(const SharedPtr<NetworkConfig> &conf)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user