mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-05 03:53:44 +02:00
Don't need to announce on multicast leave.
This commit is contained in:
parent
51f46a009a
commit
6807ccd710
1 changed files with 7 additions and 16 deletions
|
@ -148,23 +148,14 @@ 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);
|
||||||
{
|
std::vector<MulticastGroup> nmg;
|
||||||
Mutex::Lock _l(_lock);
|
for(std::vector<MulticastGroup>::const_iterator i(_myMulticastGroups.begin());i!=_myMulticastGroups.end();++i) {
|
||||||
|
if (*i != mg)
|
||||||
std::vector<MulticastGroup> nmg;
|
nmg.push_back(*i);
|
||||||
for(std::vector<MulticastGroup>::const_iterator i(_myMulticastGroups.begin());i!=_myMulticastGroups.end();++i) {
|
|
||||||
if (*i != mg)
|
|
||||||
nmg.push_back(*i);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (nmg.size() != _myMulticastGroups.size()) {
|
|
||||||
_myMulticastGroups.swap(nmg);
|
|
||||||
needAnnounce = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (needAnnounce)
|
if (nmg.size() != _myMulticastGroups.size())
|
||||||
_announceMulticastGroups();
|
_myMulticastGroups.swap(nmg);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Network::applyConfiguration(const SharedPtr<NetworkConfig> &conf)
|
bool Network::applyConfiguration(const SharedPtr<NetworkConfig> &conf)
|
||||||
|
|
Loading…
Add table
Reference in a new issue