Skip to content

Commit

Permalink
Fix neighbor doesn't update all attribute (#2577)
Browse files Browse the repository at this point in the history
* Fix neighbor doesn't update all attribute
  • Loading branch information
iris00522 authored Jan 3, 2023
1 parent bdedf69 commit 4395cea
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions orchagent/neighorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -912,15 +912,18 @@ bool NeighOrch::addNeighbor(const NeighborEntry &neighborEntry, const MacAddress
}
else if (isHwConfigured(neighborEntry))
{
status = sai_neighbor_api->set_neighbor_entry_attribute(&neighbor_entry, &neighbor_attr);
if (status != SAI_STATUS_SUCCESS)
for (auto itr : neighbor_attrs)
{
SWSS_LOG_ERROR("Failed to update neighbor %s on %s, rv:%d",
macAddress.to_string().c_str(), alias.c_str(), status);
task_process_status handle_status = handleSaiSetStatus(SAI_API_NEIGHBOR, status);
if (handle_status != task_success)
status = sai_neighbor_api->set_neighbor_entry_attribute(&neighbor_entry, &itr);
if (status != SAI_STATUS_SUCCESS)
{
return parseHandleSaiStatusFailure(handle_status);
SWSS_LOG_ERROR("Failed to update neighbor %s on %s, attr.id=0x%x, rv:%d",
macAddress.to_string().c_str(), alias.c_str(), itr.id, status);
task_process_status handle_status = handleSaiSetStatus(SAI_API_NEIGHBOR, status);
if (handle_status != task_success)
{
return parseHandleSaiStatusFailure(handle_status);
}
}
}
SWSS_LOG_NOTICE("Updated neighbor %s on %s", macAddress.to_string().c_str(), alias.c_str());
Expand Down

0 comments on commit 4395cea

Please sign in to comment.