Skip to content

Commit

Permalink
orchagent: Updating the route next hop ID also sets action to forward (
Browse files Browse the repository at this point in the history
  • Loading branch information
Shuotian Cheng authored Nov 16, 2016
1 parent 687926b commit 9855b86
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions orchagent/routeorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,7 @@ bool RouteOrch::addRoute(IpPrefix ipPrefix, IpAddresses nextHops)
}
else
{
/* Set the next hop ID to a new value */
sai_status_t status = sai_route_api->set_route_attribute(&route_entry, &route_attr);
if (status != SAI_STATUS_SUCCESS)
{
Expand All @@ -448,6 +449,18 @@ bool RouteOrch::addRoute(IpPrefix ipPrefix, IpAddresses nextHops)
return false;
}

/* Set the packet action to forward */
route_attr.id = SAI_ROUTE_ATTR_PACKET_ACTION;
route_attr.value.s32 = SAI_PACKET_ACTION_FORWARD;

status = sai_route_api->set_route_attribute(&route_entry, &route_attr);
if (status != SAI_STATUS_SUCCESS)
{
SWSS_LOG_ERROR("Failed to set route %s with packet action forward, %d",
ipPrefix.to_string().c_str(), status);
return false;
}

/* Increase the ref_count for the next hop (group) entry */
increaseNextHopRefCount(nextHops);

Expand Down

0 comments on commit 9855b86

Please sign in to comment.