diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-04-06 19:34:36 -0700 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-04-06 19:34:36 -0700 |
commit | 758bf949db708358b1ad82297fc859b16cb3c4d2 (patch) | |
tree | cc6ae033f9eeeb61dd82a0aefc03eff1257b7d96 | |
parent | 4e691c8e22ced64a4c7a34fe90ef37dc2ffefb87 (diff) | |
download | infinitytier-758bf949db708358b1ad82297fc859b16cb3c4d2.tar.gz infinitytier-758bf949db708358b1ad82297fc859b16cb3c4d2.zip |
Check for subscribed multicast groups should be able to check groups bridged behind me.
-rw-r--r-- | node/Multicaster.cpp | 2 | ||||
-rw-r--r-- | node/Network.hpp | 8 |
2 files changed, 7 insertions, 3 deletions
diff --git a/node/Multicaster.cpp b/node/Multicaster.cpp index 1c05e2df..44a8d86a 100644 --- a/node/Multicaster.cpp +++ b/node/Multicaster.cpp @@ -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 SharedPtr<Network> network(RR->node->network(nwid)); - if ((network)&&(network->subscribedToMulticastGroup(mg))) { + if ((network)&&(network->subscribedToMulticastGroup(mg,true))) { RR->identity.address().appendTo(appendTo); ++totalKnown; ++added; diff --git a/node/Network.hpp b/node/Network.hpp index ada491a6..fa76152b 100644 --- a/node/Network.hpp +++ b/node/Network.hpp @@ -116,10 +116,14 @@ public: * @param mg Multicast group * @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); - 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; } /** |