From 5e39a2896d18565dbaff264466c5f4868de084f1 Mon Sep 17 00:00:00 2001 From: Tim Young Date: Sat, 13 Apr 2019 10:08:32 -0500 Subject: [PATCH] No routing/sending destination for ZeroIPString pinging 0.0.0.0 should not go anywhere, but previously it could be routed anywhere by default gateways etc. Scenario: Level 3 It's dead Jim 1.) set the gateway for PC2 to router2 2.) ping net_switch1 The ping travels halfway around the network before it is dropped. Even worse is L4 Who done it, where originally the puzzle could be solved by just pinging 0.0.0.0 enough times. --- EduNetworkBuilder/NetworkDevice.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/EduNetworkBuilder/NetworkDevice.cs b/EduNetworkBuilder/NetworkDevice.cs index d5ffeea..14de7f4 100644 --- a/EduNetworkBuilder/NetworkDevice.cs +++ b/EduNetworkBuilder/NetworkDevice.cs @@ -2832,7 +2832,12 @@ namespace EduNetworkBuilder NetworkCard tCard = null; NB_IPAddress DestAddr; string DHCPGW = ""; - foreach( NB_IPAddress ip in RouteTable) + + //Do not ping the zero string. Should not go anywhere + if (dest != null && dest.GetIPString == NB.ZeroIPString) + return new NB_IPAddress(NB.ZeroIPString); + + foreach ( NB_IPAddress ip in RouteTable) { if (ip.IsLocal(dest)) return new NB_IPAddress(ip.GetGateway.ToIpString());//We return the gateway