Skip to content

Commit

Permalink
Update FDB state table when , MAC entries are modified as dynamic_loc…
Browse files Browse the repository at this point in the history
…al. (#2575)

* Update FDB state table when , MAC entries are modified as dynamic_local.

* commit to trigger build again.
  • Loading branch information
prasanna-cls authored Dec 20, 2022
1 parent beaac71 commit f1c0a75
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions orchagent/fdborch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1462,6 +1462,11 @@ bool FdbOrch::addFdbEntry(const FdbEntry& entry, const string& port_name,
{
//If the MAC is dynamic_local change the origin accordingly
//MAC is added/updated as dynamic to allow aging.
SWSS_LOG_INFO("MAC-Update Modify to dynamic FDB %s in %s on from-%s:to-%s from-%s:to-%s origin-%d-to-%d",
entry.mac.to_string().c_str(), vlan.m_alias.c_str(), oldPort.m_alias.c_str(),
port_name.c_str(), oldType.c_str(), fdbData.type.c_str(),
oldOrigin, fdbData.origin);

storeFdbData.origin = FDB_ORIGIN_LEARN;
storeFdbData.type = "dynamic";
}
Expand All @@ -1470,8 +1475,10 @@ bool FdbOrch::addFdbEntry(const FdbEntry& entry, const string& port_name,

string key = "Vlan" + to_string(vlan.m_vlan_info.vlan_id) + ":" + entry.mac.to_string();

if ((fdbData.origin != FDB_ORIGIN_MCLAG_ADVERTIZED) &&
(fdbData.origin != FDB_ORIGIN_VXLAN_ADVERTIZED))
if (((fdbData.origin != FDB_ORIGIN_MCLAG_ADVERTIZED) &&
(fdbData.origin != FDB_ORIGIN_VXLAN_ADVERTIZED)) ||
((fdbData.origin == FDB_ORIGIN_MCLAG_ADVERTIZED) &&
(fdbData.type == "dynamic_local")))
{
/* State-DB is updated only for Local Mac addresses */
// Write to StateDb
Expand Down

0 comments on commit f1c0a75

Please sign in to comment.