Skip to content

Commit

Permalink
Ipv4NetworkConfigurator: Added check for configuring the routes for t…
Browse files Browse the repository at this point in the history
…he network interface in configureRoutingTable.

Fixed broken fingerprint tests.
  • Loading branch information
levy committed Feb 16, 2024
1 parent 85e77d8 commit d74db5f
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,11 @@ void Ipv4NetworkConfigurator::configureRoutingTable(Node *node)
auto route = check_and_cast<Ipv4Route *>(routingTable->getRoute(i));
if (route->getSourceType() == IRoute::MANUAL && route->getSource() == this) {
auto predicate = [&] (const Ipv4Route *other) { return equalRoutes(route, other); };
if (std::find_if(node->staticRoutes.begin(), node->staticRoutes.end(), predicate) != node->staticRoutes.end())
if (contains(node->configuredNetworkInterfaces, route->getInterface()) &&
std::find_if(node->staticRoutes.begin(), node->staticRoutes.end(), predicate) != node->staticRoutes.end())
{
i++;
}
else {
EV_DETAIL << "Removing route" << EV_FIELD(route) << EV_FIELD(nodePath) << endl;
routingTable->deleteRoute(route);
Expand Down

0 comments on commit d74db5f

Please sign in to comment.