From 2f8936181ce82bb88cd12e7534b11d93753147b7 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Sat, 21 Jun 2014 08:36:23 -0700 Subject: [PATCH] Debug code -- temporary. --- node/Switch.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/node/Switch.cpp b/node/Switch.cpp index 88ad8f5d6..3fff3f55b 100644 --- a/node/Switch.cpp +++ b/node/Switch.cpp @@ -120,7 +120,7 @@ void Switch::onLocalEthernet(const SharedPtr &network,const MAC &from,c MulticastGroup mg(to,0); 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)) { + 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 // Also: enableBroadcast() does not apply to ARP since it's required for IPv4 mg = MulticastGroup::deriveMulticastGroupForAddressResolution(InetAddress(data.field(24,4),4,0)); @@ -264,6 +264,7 @@ void Switch::onLocalEthernet(const SharedPtr &network,const MAC &from,c } for(unsigned int b=0;b %s@%s\n",from.toString().c_str(),_r->identity.address().toString().c_str(),to.toString().c_str(),bridges[b].toString().c_str()); Packet outp(bridges[b],_r->identity.address(),Packet::VERB_EXT_FRAME); outp.append(network->id()); outp.append((unsigned char)0);