From 6284528248306533555b2852de9db4a257e9b9f6 Mon Sep 17 00:00:00 2001 From: Tim Young Date: Tue, 1 Sep 2015 17:19:00 -0500 Subject: [PATCH] Wireless router dhcp server issue that crept in --- EduNetworkBuilder/NetworkCard.cs | 9 +++++++-- EduNetworkBuilder/NetworkDevice.cs | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/EduNetworkBuilder/NetworkCard.cs b/EduNetworkBuilder/NetworkCard.cs index d029198..96e48e9 100644 --- a/EduNetworkBuilder/NetworkCard.cs +++ b/EduNetworkBuilder/NetworkCard.cs @@ -519,12 +519,17 @@ namespace EduNetworkBuilder if (tPacket.InboundNic == this) break; //This is the port we came in on. Do not sent it back out this port nPacket = new Packet(tPacket); - if((tPacket.InboundNic != null && tPacket.InboundNic.GetNicType == NicType.wan) || tPacket.InboundNic == null) + if((tPacket.InboundNic != null && tPacket.InboundNic.GetNicType == NicType.wan) || tPacket.InboundNic == null || tPacket.destMAC == "") { //We need to find destination MAC and set source MAC nPacket.sourceMAC = MAC; //Update the MAC - nPacket.destMAC = WhereFrom.LookupArpFromIP(tPacket.OutboundIP.GetIPString); + string getMAC=""; + if (tPacket.OutboundIP != null) + getMAC = WhereFrom.LookupArpFromIP(tPacket.OutboundIP.GetIPString); + else if(tPacket.destIP != null) + getMAC = WhereFrom.LookupArpFromIP(tPacket.destIP.GetIPString); + if (getMAC != "") nPacket.destMAC = getMAC; if (nPacket.MyType == PacketType.arp_request) { nPacket.destMAC = NB.BroadcastMACString; diff --git a/EduNetworkBuilder/NetworkDevice.cs b/EduNetworkBuilder/NetworkDevice.cs index b21c17c..3eba9cb 100644 --- a/EduNetworkBuilder/NetworkDevice.cs +++ b/EduNetworkBuilder/NetworkDevice.cs @@ -2197,7 +2197,7 @@ namespace EduNetworkBuilder if (myType == NetworkComponentType.wap) return true; if (myType == NetworkComponentType.wrouter) return true; if (myType == NetworkComponentType.wrepeater) return true; - if (myType == NetworkComponentType.wrouter) return true; + if (myType == NetworkComponentType.wbridge) return true; return false; } ///