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.
This commit is contained in:
Tim Young 2019-04-13 10:08:32 -05:00
parent 4a72518ccc
commit 5e39a2896d
1 changed files with 6 additions and 1 deletions

View File

@ -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