Apply multicast rate limits on a network to ourselves and do not send multicasts that would exceed limits, for GitHub issue #55
This commit is contained in:
parent
67a85221d5
commit
ab5a460177
2 changed files with 6 additions and 1 deletions
|
@ -108,6 +108,11 @@ void Switch::onLocalEthernet(const SharedPtr<Network> &network,const MAC &from,c
|
|||
mg = MulticastGroup::deriveMulticastGroupForAddressResolution(InetAddress(data.field(24,4),4,0));
|
||||
}
|
||||
|
||||
if (!network->updateAndCheckMulticastBalance(_r->identity.address(),mg,data.size())) {
|
||||
TRACE("%s: didn't multicast %d bytes, quota exceeded for multicast group %s",network->tapDeviceName().c_str(),(int)data.size(),mg.toString().c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
const unsigned int mcid = ++_multicastIdCounter & 0xffffff;
|
||||
const uint16_t bloomNonce = (uint16_t)(_r->prng->next32() & 0xffff); // doesn't need to be cryptographically strong
|
||||
unsigned char bloom[ZT_PROTO_VERB_MULTICAST_FRAME_LEN_PROPAGATION_BLOOM];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue