Skip to content

Commit

Permalink
[orchagent]: Fixing the issue that routes cannot be removed (sonic-ne…
Browse files Browse the repository at this point in the history
…t#172)

When routes' next hop interfaces are updated to eth0, they need to
be removed from the ASIC.

Signed-off-by: Shuotian Cheng <shuche@microsoft.com>
  • Loading branch information
Shuotian Cheng authored Mar 6, 2017
1 parent dc33b75 commit 65c8707
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion orchagent/routeorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,17 @@ void RouteOrch::doTask(Consumer& consumer)
// TODO: need to split aliases with ',' and verify the next hops?
if (alias == "eth0" || alias == "lo" || alias == "docker0")
{
it = consumer.m_toSync.erase(it);
/* If any existing routes are updated to point to the
* above interfaces, remove them from the ASIC. */
if (m_syncdRoutes.find(ip_prefix) != m_syncdRoutes.end())
{
if (removeRoute(ip_prefix))
it = consumer.m_toSync.erase(it);
else
it++;
}
else
it = consumer.m_toSync.erase(it);
continue;
}

Expand Down

0 comments on commit 65c8707

Please sign in to comment.