Fix an odd traceroute reply issue. Routers would reply if the packet had the start and dest on the same subnet.
This commit is contained in:
parent
29e6d64614
commit
efd3f26431
@ -2594,8 +2594,15 @@ namespace EduNetworkBuilder
|
|||||||
{
|
{
|
||||||
//The packet reached the end of its ttl. Bounce back.
|
//The packet reached the end of its ttl. Bounce back.
|
||||||
//this packet ends, another begins.
|
//this packet ends, another begins.
|
||||||
|
|
||||||
Network myNet = NB.GetNetwork();
|
Network myNet = NB.GetNetwork();
|
||||||
|
|
||||||
|
//There is a fringe case. Do not bounce back if the target device is on the same LAN that this packet came in on
|
||||||
|
// Otherwise, the traceroute gets an odd reply.
|
||||||
|
// Do not do a tracert reply if the src and dest are local to each-other, and if this is not the device that is the endpoint
|
||||||
|
bool LocalToEachOther = tPacket.sourceIP.IsLocal(new IPAddress(tPacket.payloadData));
|
||||||
|
if (LocalToEachOther && RoutesPackets() && !HasMac(tPacket.destMAC)) return false;
|
||||||
|
|
||||||
//We create a new packet
|
//We create a new packet
|
||||||
Packet nPacket = new Packet(this, tPacket.sourceIP, tPacket.payloadData, PacketType.tracert_reply, tPacket.packetID);
|
Packet nPacket = new Packet(this, tPacket.sourceIP, tPacket.payloadData, PacketType.tracert_reply, tPacket.packetID);
|
||||||
nPacket.OrigTTL = tPacket.OrigTTL;
|
nPacket.OrigTTL = tPacket.OrigTTL;
|
||||||
|
Loading…
Reference in New Issue
Block a user