Skip to content

Commit

Permalink
[routeorch] Fixing bug with multiple routes pointing to nhg (sonic-ne…
Browse files Browse the repository at this point in the history
…t#2999)

- Fixed a bug where multiple routes pointing to the same nhg would not remove the route from m_nextHops cache in routeorch
  • Loading branch information
Ndancejic authored Dec 27, 2023
1 parent 5f367eb commit 8fa982d
Show file tree
Hide file tree
Showing 2 changed files with 230 additions and 355 deletions.
21 changes: 11 additions & 10 deletions orchagent/routeorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2497,20 +2497,21 @@ bool RouteOrch::removeRoutePost(const RouteBulkContext& ctx)
{
SWSS_LOG_NOTICE("Remove Nexthop Group %s", ol_nextHops.to_string().c_str());
m_bulkNhgReducedRefCnt.emplace(it_route->second.nhg_key, 0);
if (mux_orch->isMuxNexthops(ol_nextHops))
}
if (mux_orch->isMuxNexthops(ol_nextHops))
{
SWSS_LOG_NOTICE("Remove mux Nexthop %s", ol_nextHops.to_string().c_str());
RouteKey routekey = { vrf_id, ipPrefix };
auto nexthop_list = ol_nextHops.getNextHops();
for (auto nh = nexthop_list.begin(); nh != nexthop_list.end(); nh++)
{
SWSS_LOG_NOTICE("Remove mux Nexthop %s", ol_nextHops.to_string().c_str());
RouteKey routekey = { vrf_id, ipPrefix };
auto nexthop_list = ol_nextHops.getNextHops();
for (auto nh = nexthop_list.begin(); nh != nexthop_list.end(); nh++)
if (!nh->ip_address.isZero())
{
if (!nh->ip_address.isZero())
{
removeNextHopRoute(*nh, routekey);
}
SWSS_LOG_NOTICE("removeNextHopRoute");
removeNextHopRoute(*nh, routekey);
}
mux_orch->updateRoute(ipPrefix, false);
}
mux_orch->updateRoute(ipPrefix, false);
}
}
else if (ol_nextHops.is_overlay_nexthop())
Expand Down
Loading

0 comments on commit 8fa982d

Please sign in to comment.