Skip to content

Commit 4395cea

Browse files
authored
Fix neighbor doesn't update all attribute (sonic-net#2577)
* Fix neighbor doesn't update all attribute
1 parent bdedf69 commit 4395cea

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

orchagent/neighorch.cpp

+10-7
Original file line numberDiff line numberDiff line change
@@ -912,15 +912,18 @@ bool NeighOrch::addNeighbor(const NeighborEntry &neighborEntry, const MacAddress
912912
}
913913
else if (isHwConfigured(neighborEntry))
914914
{
915-
status = sai_neighbor_api->set_neighbor_entry_attribute(&neighbor_entry, &neighbor_attr);
916-
if (status != SAI_STATUS_SUCCESS)
915+
for (auto itr : neighbor_attrs)
917916
{
918-
SWSS_LOG_ERROR("Failed to update neighbor %s on %s, rv:%d",
919-
macAddress.to_string().c_str(), alias.c_str(), status);
920-
task_process_status handle_status = handleSaiSetStatus(SAI_API_NEIGHBOR, status);
921-
if (handle_status != task_success)
917+
status = sai_neighbor_api->set_neighbor_entry_attribute(&neighbor_entry, &itr);
918+
if (status != SAI_STATUS_SUCCESS)
922919
{
923-
return parseHandleSaiStatusFailure(handle_status);
920+
SWSS_LOG_ERROR("Failed to update neighbor %s on %s, attr.id=0x%x, rv:%d",
921+
macAddress.to_string().c_str(), alias.c_str(), itr.id, status);
922+
task_process_status handle_status = handleSaiSetStatus(SAI_API_NEIGHBOR, status);
923+
if (handle_status != task_success)
924+
{
925+
return parseHandleSaiStatusFailure(handle_status);
926+
}
924927
}
925928
}
926929
SWSS_LOG_NOTICE("Updated neighbor %s on %s", macAddress.to_string().c_str(), alias.c_str());

0 commit comments

Comments
 (0)