Drop packets in Ipv4L3Protocol::Receive if interface is down

This commit is contained in:
Tom Henderson
2008-11-28 07:21:26 -08:00
parent 6b0468c20b
commit bf571e8260

View File

@@ -522,8 +522,17 @@ Ipv4L3Protocol::Receive( Ptr<NetDevice> device, Ptr<const Packet> p, uint16_t pr
ipv4Interface = *i;
if (ipv4Interface->GetDevice () == device)
{
m_rxTrace (packet, index);
break;
if (ipv4Interface->IsUp ())
{
m_rxTrace (packet, index);
break;
}
else
{
NS_LOG_LOGIC ("Dropping received packet-- interface is down");
m_dropTrace (packet);
return;
}
}
index++;
}
@@ -1075,7 +1084,7 @@ Ipv4L3Protocol::SetDown (uint32_t ifaceIndex)
Ptr<Ipv4Interface> interface = GetInterface (ifaceIndex);
interface->SetDown ();
// Remove all routes that are going through this interface
// Remove all static routes that are going through this interface
bool modified = true;
while (modified)
{