Skip to content

Commit

Permalink
EigrpIpv4Pdm: Added route deletion after it was removed from Ipv4Rout…
Browse files Browse the repository at this point in the history
…ingTable.

The same thing is done EigrpIpv6Pdm, so it's nothing new.
This change keeps the fingerprints.
  • Loading branch information
levy committed Feb 8, 2024
1 parent ac2923f commit efe8eb6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/inet/routing/eigrp/pdms/EigrpIpv4Pdm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down Expand Up @@ -1189,6 +1197,7 @@ Ipv4Route *EigrpIpv4Pdm::createRTRoute(EigrpRouteSource<Ipv4Address> *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());
Expand Down

0 comments on commit efe8eb6

Please sign in to comment.