Skip to content

Commit

Permalink
[orchagent] Remove default prefix in non default vrf (sonic-net#1772)
Browse files Browse the repository at this point in the history
* Remove default prefix in non default vrf
  • Loading branch information
msosyak authored and raphaelt-nvidia committed Oct 5, 2021
1 parent 3776fee commit d72c83e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions orchagent/routeorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1906,7 +1906,7 @@ bool RouteOrch::removeRoute(RouteBulkContext& ctx)
auto& object_statuses = ctx.object_statuses;

// set to blackhole for default route
if (ipPrefix.isDefaultRoute())
if (ipPrefix.isDefaultRoute() && vrf_id == gVirtualRouterId)
{
sai_attribute_t attr;
attr.id = SAI_ROUTE_ENTRY_ATTR_PACKET_ACTION;
Expand Down Expand Up @@ -1950,7 +1950,7 @@ bool RouteOrch::removeRoutePost(const RouteBulkContext& ctx)
auto it_status = object_statuses.begin();

// set to blackhole for default route
if (ipPrefix.isDefaultRoute())
if (ipPrefix.isDefaultRoute() && vrf_id == gVirtualRouterId)
{
sai_status_t status = *it_status++;
if (status != SAI_STATUS_SUCCESS)
Expand Down Expand Up @@ -2030,7 +2030,7 @@ bool RouteOrch::removeRoutePost(const RouteBulkContext& ctx)
SWSS_LOG_INFO("Remove route %s with next hop(s) %s",
ipPrefix.to_string().c_str(), it_route->second.to_string().c_str());

if (ipPrefix.isDefaultRoute())
if (ipPrefix.isDefaultRoute() && vrf_id == gVirtualRouterId)
{
it_route_table->second[ipPrefix] = NextHopGroupKey();

Expand Down

0 comments on commit d72c83e

Please sign in to comment.