mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-05 00:40:49 +00:00
Don't transmit broadcasts if enableBroadcast is false on a network.
This commit is contained in:
parent
2861229558
commit
657f6ae342
@ -109,9 +109,14 @@ void Switch::onLocalEthernet(const SharedPtr<Network> &network,const MAC &from,c
|
|||||||
MulticastGroup mg(to,0);
|
MulticastGroup mg(to,0);
|
||||||
|
|
||||||
if (to.isBroadcast()) {
|
if (to.isBroadcast()) {
|
||||||
|
if ((etherType == ZT_ETHERTYPE_ARP)&&(data.size() == 28)&&(data[2] == 0x08)&&(data[3] == 0x00)&&(data[4] == 6)&&(data[5] == 4)&&(data[7] == 0x01)) {
|
||||||
// Cram IPv4 IP into ADI field to make IPv4 ARP broadcast channel specific and scalable
|
// Cram IPv4 IP into ADI field to make IPv4 ARP broadcast channel specific and scalable
|
||||||
if ((etherType == ZT_ETHERTYPE_ARP)&&(data.size() == 28)&&(data[2] == 0x08)&&(data[3] == 0x00)&&(data[4] == 6)&&(data[5] == 4)&&(data[7] == 0x01))
|
|
||||||
mg = MulticastGroup::deriveMulticastGroupForAddressResolution(InetAddress(data.field(24,4),4,0));
|
mg = MulticastGroup::deriveMulticastGroupForAddressResolution(InetAddress(data.field(24,4),4,0));
|
||||||
|
} else if (!nconf->enableBroadcast()) {
|
||||||
|
// Don't transmit broadcasts if this network doesn't want them
|
||||||
|
TRACE("%s: dropped broadcast since ff:ff:ff:ff:ff:ff is not enabled on network %.16llx",network->tapDeviceName().c_str(),network->id());
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!network->updateAndCheckMulticastBalance(_r->identity.address(),mg,data.size())) {
|
if (!network->updateAndCheckMulticastBalance(_r->identity.address(),mg,data.size())) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user