diff --git a/EduNetworkBuilder/Network.cs b/EduNetworkBuilder/Network.cs index e3149e3..9c190e3 100644 --- a/EduNetworkBuilder/Network.cs +++ b/EduNetworkBuilder/Network.cs @@ -177,9 +177,9 @@ namespace EduNetworkBuilder break; } } - DoAllVerifyLinks(); - DoAllAutoJoin(); } + DoAllVerifyLinks(); + DoAllAutoJoin(); if (NetMessage.GetText() != "" && !AlreadyDisplayedMessage) { //We have a message loaded on this network. Display it @@ -429,7 +429,12 @@ namespace EduNetworkBuilder public void RemoveComponent(NetworkComponent tItem) { - NetComponents.Remove(tItem); + for (int i = NetComponents.Count -1; i >= 0; i--) + { + if (NetComponents[i] == tItem) + NetComponents.RemoveAt(i); +// NetComponents.Remove(tItem); + } tItem.Destroy(); _isDirty = true; } diff --git a/EduNetworkBuilder/NetworkDevice.cs b/EduNetworkBuilder/NetworkDevice.cs index 5f37118..3051094 100644 --- a/EduNetworkBuilder/NetworkDevice.cs +++ b/EduNetworkBuilder/NetworkDevice.cs @@ -95,8 +95,8 @@ namespace EduNetworkBuilder NICs.Clear(); tnic = new NetworkCard(0, GetUniqueIdentifier, hostname, NicType.lo); NICs.Add(tnic); - tnic = new NetworkCard(0, GetUniqueIdentifier, hostname, NicType.management_interface); - NICs.Add(tnic); + //tnic = new NetworkCard(0, GetUniqueIdentifier, hostname, NicType.management_interface); + //NICs.Add(tnic); --we use the wlan interface tnic = new NetworkCard(NICs.Count(), GetUniqueIdentifier, hostname, NicType.wlan); //Add a wireless nic NICs.Add(tnic); tnic = new NetworkCard(NICs.Count(), GetUniqueIdentifier, hostname, NicType.wport); //Add a wireless port diff --git a/EduNetworkBuilder/Packet.cs b/EduNetworkBuilder/Packet.cs index c6fcab4..fc9c882 100644 --- a/EduNetworkBuilder/Packet.cs +++ b/EduNetworkBuilder/Packet.cs @@ -367,16 +367,19 @@ namespace EduNetworkBuilder Tracking.Status = "Packet failed to reach IP: " + destIP.GetIPString; MyStatus = PacketStatus.finished_failed; } - if(MyType == PacketType.ping_answer && MyStatus == PacketStatus.finished_failed) - { - myNet.NoteActionDone(NetTestType.FailedPing, destIP.GetIPString, sourceIP.GetIPString); - } - if (MyType == PacketType.ping_request && MyStatus == PacketStatus.finished_failed) - { - myNet.NoteActionDone(NetTestType.FailedPing, sourceIP.GetIPString, destIP.GetIPString); - } if (MyStatus != PacketStatus.finished) myNet.AddMessage(Tracking); //We only store finished_failed, and finished_ok + if (sourceIP != null && destIP != null) + { + if (MyType == PacketType.ping_answer && MyStatus == PacketStatus.finished_failed) + { + myNet.NoteActionDone(NetTestType.FailedPing, destIP.GetIPString, sourceIP.GetIPString); + } + if (MyType == PacketType.ping_request && MyStatus == PacketStatus.finished_failed) + { + myNet.NoteActionDone(NetTestType.FailedPing, sourceIP.GetIPString, destIP.GetIPString); + } + } } }