internet: (fixes #2402) IPv4 Interface forwarding state is not honored

This commit is contained in:
Tommso Pecorella
2016-06-13 00:09:51 +02:00
parent 90e4ab38cf
commit c9b50f9b04
3 changed files with 18 additions and 0 deletions

View File

@@ -61,6 +61,7 @@ Bugs fixed
- Bug 2396 - move utility functions to WifiPhy
- Bug 2397 - add backoff and cw tracing to EDCA
- Bug 2398 - add SNR tag to beacons and probe responses
- Bug 2402 - IPv4 Interface forwarding state is not honored
- Bug 2406 - Poor 802.11g performance in ad-hoc mode
- Bug 2414 - UdpSocket doesn't call NotifyConnectionFailed
- Bug 2419 - BsmApplication should use RecvFrom and not SocketAddressTag

View File

@@ -521,6 +521,14 @@ RoutingProtocol::RouteInput (Ptr<const Packet> p, const Ipv4Header &header,
return true;
}
// Check if input device supports IP forwarding
if (m_ipv4->IsForwarding (iif) == false)
{
NS_LOG_LOGIC ("Forwarding disabled for this interface");
ecb (p, header, Socket::ERROR_NOROUTETOHOST);
return true;
}
// Forwarding
return Forwarding (p, header, ucb, ecb);
}

View File

@@ -467,6 +467,15 @@ RoutingProtocol::RouteInput (Ptr<const Packet> p,
}
return true;
}
// Check if input device supports IP forwarding
if (m_ipv4->IsForwarding (iif) == false)
{
NS_LOG_LOGIC ("Forwarding disabled for this interface");
ecb (p, header, Socket::ERROR_NOROUTETOHOST);
return true;
}
RoutingTableEntry toDst;
if (m_routingTable.LookupRoute (dst,toDst))
{