mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-02-20 17:52:46 +00:00
Get a default rate that works for multicast.
This commit is contained in:
parent
d74b5f4bc6
commit
55e7ddba1e
@ -261,7 +261,7 @@ error_no_ZT_ARCH_defined;
|
||||
/**
|
||||
* Expiration time in ms for multicast deduplication history items
|
||||
*/
|
||||
#define ZT_MULTICAST_DEDUP_HISTORY_EXPIRE 4000
|
||||
#define ZT_MULTICAST_DEDUP_HISTORY_EXPIRE 2000
|
||||
|
||||
/**
|
||||
* Period between announcements of all multicast 'likes' in ms
|
||||
|
@ -117,8 +117,7 @@ bool Network::CertificateOfMembership::compare(const CertificateOfMembership &ot
|
||||
return true;
|
||||
}
|
||||
|
||||
// A low default global rate, fast enough for something like ARP
|
||||
const Network::MulticastRates::Rate Network::MulticastRates::GLOBAL_DEFAULT_RATE(128,128,64);
|
||||
const Network::MulticastRates::Rate Network::MulticastRates::GLOBAL_DEFAULT_RATE(65535,65535,64);
|
||||
|
||||
const char *Network::statusString(const Status s)
|
||||
throw()
|
||||
|
@ -105,10 +105,16 @@ void Switch::onLocalEthernet(const SharedPtr<Network> &network,const MAC &from,c
|
||||
mg = MulticastGroup::deriveMulticastGroupForAddressResolution(InetAddress(data.field(24,4),4,0));
|
||||
}
|
||||
|
||||
// Check our own multicasts against the global rate for this network
|
||||
// just to be polite.
|
||||
uint64_t crc = Multicaster::computeMulticastDedupCrc(network->id(),from,mg,etherType,data.data(),data.size());
|
||||
uint64_t now = Utils::now();
|
||||
|
||||
if (_r->multicaster->checkDuplicate(crc,now)) {
|
||||
LOG("%s/%.16llx: multicast group %s: dropped %u bytes, duplicate multicast in too short a time frame",network->tap().deviceName().c_str(),(unsigned long long)network->id(),mg.toString().c_str(),(unsigned int)data.size());
|
||||
return;
|
||||
}
|
||||
_r->multicaster->addToDedupHistory(crc,now);
|
||||
if (!network->updateAndCheckMulticastBalance(_r->identity.address(),mg,data.size())) {
|
||||
LOG("didn't send local multicast %u byte multicast packet to network %.16llx: not within budget for multicast group %s",(unsigned int)data.size(),(unsigned long long)network->id(),mg.toString().c_str());
|
||||
LOG("%s/%.16llx: multicast group %s: dropped %u bytes, out of budget",network->tap().deviceName().c_str(),(unsigned long long)network->id(),mg.toString().c_str(),(unsigned int)data.size());
|
||||
return;
|
||||
}
|
||||
|
||||
@ -124,7 +130,7 @@ void Switch::onLocalEthernet(const SharedPtr<Network> &network,const MAC &from,c
|
||||
bloom,
|
||||
ZT_MULTICAST_PROPAGATION_BREADTH,
|
||||
propPeers,
|
||||
Utils::now());
|
||||
now);
|
||||
|
||||
if (!np)
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user