From efe8eb672022e4390b8cafc58497991fe9a383ce Mon Sep 17 00:00:00 2001 From: Levente Meszaros Date: Thu, 8 Feb 2024 14:24:48 +0100 Subject: [PATCH] EigrpIpv4Pdm: Added route deletion after it was removed from Ipv4RoutingTable. The same thing is done EigrpIpv6Pdm, so it's nothing new. This change keeps the fingerprints. --- src/inet/routing/eigrp/pdms/EigrpIpv4Pdm.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/inet/routing/eigrp/pdms/EigrpIpv4Pdm.cc b/src/inet/routing/eigrp/pdms/EigrpIpv4Pdm.cc index 7a7cf08016d..761a4c1620d 100644 --- a/src/inet/routing/eigrp/pdms/EigrpIpv4Pdm.cc +++ b/src/inet/routing/eigrp/pdms/EigrpIpv4Pdm.cc @@ -193,6 +193,14 @@ void EigrpIpv4Pdm::processIfaceStateChange(NetworkInterface *iface) } } else if (!iface->isUp() || !iface->hasCarrier()) { // an interface goes down + for (int i = 0; i < rt->getNumRoutes();) { + auto route = rt->getRoute(i); + if (route->getSourceType() == IRoute::EIGRP && route->getSource() == this && route->getInterface() == iface) + rt->deleteRoute(route); + else + i++; + } + eigrpIface = this->eigrpIft->findInterfaceById(ifaceId); if (eigrpIface != nullptr && eigrpIface->isEnabled()) { @@ -1189,6 +1197,7 @@ Ipv4Route *EigrpIpv4Pdm::createRTRoute(EigrpRouteSource *successor) rtEntry->setDestination(route->getRouteAddress()); rtEntry->setNetmask(route->getRouteMask()); rtEntry->setSourceType(IRoute::EIGRP); + rtEntry->setSource(this); rtEntry->setInterface(ift->getInterfaceById(successor->getIfaceId())); rtEntry->setGateway(successor->getNextHop()); setRTRouteMetric(rtEntry, successor->getMetric());