Skip to content

Commit

Permalink
[fdborch] Fixed Orchagent crash in FDB flush on port disable. (sonic-…
Browse files Browse the repository at this point in the history
…net#1369)

* [fdborch] Fixed Orchagent crash in FDB flush on port disable.
Signed-off-by: Rajkumar Pennadam Ramamoorthy <rpennadamram@marvell.com>
  • Loading branch information
rajkumar38 authored Jul 29, 2020
1 parent a1530e3 commit 26e1723
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions orchagent/fdborch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,12 +232,13 @@ void FdbOrch::update(sai_fdb_event_t type,
update.entry.mac.to_string().c_str(),
vlanName.c_str(), update.port.m_alias.c_str());

for (const auto& itr : m_entries)
for (auto itr = m_entries.begin(); itr != m_entries.end();)
{
if (itr.port_name == update.port.m_alias)
auto next_item = std::next(itr);
if (itr->port_name == update.port.m_alias)
{
update.entry.mac = itr.mac;
update.entry.bv_id = itr.bv_id;
update.entry.mac = itr->mac;
update.entry.bv_id = itr->bv_id;
update.add = false;

storeFdbEntryState(update);
Expand All @@ -246,7 +247,8 @@ void FdbOrch::update(sai_fdb_event_t type,
{
observer->update(SUBJECT_TYPE_FDB_CHANGE, &update);
}
}
}
itr = next_item;
}
}
else if (bridge_port_id == SAI_NULL_OBJECT_ID)
Expand Down

0 comments on commit 26e1723

Please sign in to comment.