From d74db5f1b7110c8e02b8005d21e5640eb427ec3c Mon Sep 17 00:00:00 2001 From: Levente Meszaros Date: Fri, 16 Feb 2024 10:46:30 +0100 Subject: [PATCH] Ipv4NetworkConfigurator: Added check for configuring the routes for the network interface in configureRoutingTable. Fixed broken fingerprint tests. --- .../configurator/ipv4/Ipv4NetworkConfigurator.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/inet/networklayer/configurator/ipv4/Ipv4NetworkConfigurator.cc b/src/inet/networklayer/configurator/ipv4/Ipv4NetworkConfigurator.cc index bca01580da3..da72a9b0e05 100644 --- a/src/inet/networklayer/configurator/ipv4/Ipv4NetworkConfigurator.cc +++ b/src/inet/networklayer/configurator/ipv4/Ipv4NetworkConfigurator.cc @@ -243,8 +243,11 @@ void Ipv4NetworkConfigurator::configureRoutingTable(Node *node) auto route = check_and_cast(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);