From f1c0a758d64bb4e127fcb6fd2101d6a42b77015f Mon Sep 17 00:00:00 2001 From: prasanna-cls <110149984+prasanna-cls@users.noreply.github.com> Date: Tue, 20 Dec 2022 10:05:32 +0530 Subject: [PATCH] Update FDB state table when , MAC entries are modified as dynamic_local. (#2575) * Update FDB state table when , MAC entries are modified as dynamic_local. * commit to trigger build again. --- orchagent/fdborch.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/orchagent/fdborch.cpp b/orchagent/fdborch.cpp index 720d6c5c6634..91ae4dbd9581 100644 --- a/orchagent/fdborch.cpp +++ b/orchagent/fdborch.cpp @@ -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"; } @@ -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