summaryrefslogtreecommitdiff
path: root/node/Switch.cpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2013-07-06 15:56:12 -0400
committerAdam Ierymenko <adam.ierymenko@gmail.com>2013-07-06 15:56:12 -0400
commit2eaac3891ec5f6da0ba9577bd032fd692392dd40 (patch)
treee20e47dc23bc290b96268084baa32e891fff7b76 /node/Switch.cpp
parent7f3dea018c8034208b40e2633b04d06f917c1957 (diff)
downloadinfinitytier-2eaac3891ec5f6da0ba9577bd032fd692392dd40.tar.gz
infinitytier-2eaac3891ec5f6da0ba9577bd032fd692392dd40.zip
Enable ff:ff:ff:ff:ff:ff w/no ADI a.k.a. broadcast. YOLO.
Diffstat (limited to 'node/Switch.cpp')
-rw-r--r--node/Switch.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/node/Switch.cpp b/node/Switch.cpp
index 87218b0d..ed646308 100644
--- a/node/Switch.cpp
+++ b/node/Switch.cpp
@@ -252,9 +252,11 @@ void Switch::onLocalEthernet(const SharedPtr<Network> &network,const MAC &from,c
if (to.isMulticast()) {
MulticastGroup mg(to,0);
- // Handle special cases: IPv4 ARP
- 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));
+ if (to.isBroadcast()) {
+ // 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));
+ }
// Remember this message's CRC, but don't drop if we've already seen it
// since it's our own.