mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-06 20:43:44 +02:00
Check for subscribed multicast groups should be able to check groups bridged behind me.
This commit is contained in:
parent
4e691c8e22
commit
758bf949db
2 changed files with 7 additions and 3 deletions
|
@ -81,7 +81,7 @@ unsigned int Multicaster::gather(const Address &queryingPeer,uint64_t nwid,const
|
||||||
|
|
||||||
{ // Return myself if I am a member of this group
|
{ // Return myself if I am a member of this group
|
||||||
SharedPtr<Network> network(RR->node->network(nwid));
|
SharedPtr<Network> network(RR->node->network(nwid));
|
||||||
if ((network)&&(network->subscribedToMulticastGroup(mg))) {
|
if ((network)&&(network->subscribedToMulticastGroup(mg,true))) {
|
||||||
RR->identity.address().appendTo(appendTo);
|
RR->identity.address().appendTo(appendTo);
|
||||||
++totalKnown;
|
++totalKnown;
|
||||||
++added;
|
++added;
|
||||||
|
|
|
@ -116,10 +116,14 @@ public:
|
||||||
* @param mg Multicast group
|
* @param mg Multicast group
|
||||||
* @return True if this network endpoint / peer is a member
|
* @return True if this network endpoint / peer is a member
|
||||||
*/
|
*/
|
||||||
bool subscribedToMulticastGroup(const MulticastGroup &mg) const
|
bool subscribedToMulticastGroup(const MulticastGroup &mg,bool includeBridgedGroups) const
|
||||||
{
|
{
|
||||||
Mutex::Lock _l(_lock);
|
Mutex::Lock _l(_lock);
|
||||||
return (std::find(_myMulticastGroups.begin(),_myMulticastGroups.end(),mg) != _myMulticastGroups.end());
|
if (std::find(_myMulticastGroups.begin(),_myMulticastGroups.end(),mg) != _myMulticastGroups.end())
|
||||||
|
return true;
|
||||||
|
else if (includeBridgedGroups)
|
||||||
|
return (_multicastGroupsBehindMe.find(mg) != _multicastGroupsBehindMe.end());
|
||||||
|
else return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue