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.
This commit is contained in:
parent
1a76455986
commit
3443b203e4
10 changed files with 106 additions and 41 deletions
|
@ -400,6 +400,7 @@ void Switch::announceMulticastGroups(const std::map< SharedPtr<Network>,std::set
|
|||
outp.reset((*p)->address(),_r->identity.address(),Packet::VERB_MULTICAST_LIKE);
|
||||
}
|
||||
|
||||
// network ID, MAC, ADI
|
||||
outp.append((uint64_t)nwmgs->first->id());
|
||||
outp.append(mg->mac().data,6);
|
||||
outp.append((uint32_t)mg->adi());
|
||||
|
@ -412,6 +413,30 @@ void Switch::announceMulticastGroups(const std::map< SharedPtr<Network>,std::set
|
|||
}
|
||||
}
|
||||
|
||||
void Switch::announceMulticastGroups(const SharedPtr<Peer> &peer)
|
||||
{
|
||||
Packet outp(peer->address(),_r->identity.address(),Packet::VERB_MULTICAST_LIKE);
|
||||
std::vector< SharedPtr<Network> > networks(_r->nc->networks());
|
||||
for(std::vector< SharedPtr<Network> >::iterator n(networks.begin());n!=networks.end();++n) {
|
||||
if (((*n)->isAllowed(peer->address()))||(_r->topology->isSupernode(peer->address()))) {
|
||||
std::set<MulticastGroup> mgs((*n)->multicastGroups());
|
||||
for(std::set<MulticastGroup>::iterator mg(mgs.begin());mg!=mgs.end();++mg) {
|
||||
if ((outp.size() + 18) > ZT_UDP_DEFAULT_PAYLOAD_MTU) {
|
||||
send(outp,true);
|
||||
outp.reset(peer->address(),_r->identity.address(),Packet::VERB_MULTICAST_LIKE);
|
||||
}
|
||||
|
||||
// network ID, MAC, ADI
|
||||
outp.append((uint64_t)(*n)->id());
|
||||
outp.append(mg->mac().data,6);
|
||||
outp.append((uint32_t)mg->adi());
|
||||
}
|
||||
}
|
||||
}
|
||||
if (outp.size() > ZT_PROTO_MIN_PACKET_LENGTH)
|
||||
send(outp,true);
|
||||
}
|
||||
|
||||
void Switch::requestWhois(const Address &addr)
|
||||
{
|
||||
TRACE("requesting WHOIS for %s",addr.toString().c_str());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue