Skip to content

Commit

Permalink
Fix for "orchagent crashed when trying to delete fdb static entry wit…
Browse files Browse the repository at this point in the history
…h swssconfig sonic-net#11046" (sonic-net#2332)

* Fix updated to not flush static mac
  • Loading branch information
anilkpan committed Jun 22, 2022
1 parent 0c789e6 commit d82874d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion orchagent/fdborch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,12 @@ void FdbOrch::doTask(NotificationConsumer& consumer)
{
if (op == "ALL")
{
status = sai_fdb_api->flush_fdb_entries(gSwitchId, 0, NULL);
vector<sai_attribute_t> attrs;
sai_attribute_t attr;
attr.id = SAI_FDB_FLUSH_ATTR_ENTRY_TYPE;
attr.value.s32 = SAI_FDB_FLUSH_ENTRY_TYPE_DYNAMIC;
attrs.push_back(attr);
status = sai_fdb_api->flush_fdb_entries(gSwitchId, (uint32_t)attrs.size(), attrs.data());
if (status != SAI_STATUS_SUCCESS)
{
SWSS_LOG_ERROR("Flush fdb failed, return code %x", status);
Expand Down Expand Up @@ -1056,6 +1061,11 @@ void FdbOrch::flushFDBEntries(sai_object_id_t bridge_port_oid,
attr.value.oid = vlan_oid;
attrs.push_back(attr);
}

/* do not flush static mac */
attr.id = SAI_FDB_FLUSH_ATTR_ENTRY_TYPE;
attr.value.s32 = SAI_FDB_FLUSH_ENTRY_TYPE_DYNAMIC;
attrs.push_back(attr);

SWSS_LOG_INFO("Flushing FDB bridge_port_oid: 0x%" PRIx64 ", and bvid_oid:0x%" PRIx64 ".", bridge_port_oid, vlan_oid);

Expand Down

0 comments on commit d82874d

Please sign in to comment.