diff --git a/fdbsyncd/fdbsync.cpp b/fdbsyncd/fdbsync.cpp index 0cdcc63214..0d71f721dc 100644 --- a/fdbsyncd/fdbsync.cpp +++ b/fdbsyncd/fdbsync.cpp @@ -307,13 +307,6 @@ void FdbSync::updateLocalMac (struct m_fdb_info *info) op = "replace"; port_name = info->port_name; fdb_type = info->type; - /* Check if this vlan+key is also learned by vxlan neighbor then delete learned on */ - if (m_mac.find(key) != m_mac.end()) - { - macDelVxlanEntry(key, info); - SWSS_LOG_INFO("Local learn event deleting from VXLAN table DEL_KEY %s", key.c_str()); - macDelVxlan(key); - } } else { @@ -335,7 +328,7 @@ void FdbSync::updateLocalMac (struct m_fdb_info *info) } else { - type = "static"; + type = "sticky static"; } const std::string cmds = std::string("") @@ -347,6 +340,17 @@ void FdbSync::updateLocalMac (struct m_fdb_info *info) SWSS_LOG_INFO("cmd:%s, res=%s, ret=%d", cmds.c_str(), res.c_str(), ret); + if (info->op_type == FDB_OPER_ADD) + { + /* Check if this vlan+key is also learned by vxlan neighbor then delete the dest entry */ + if (m_mac.find(key) != m_mac.end()) + { + macDelVxlanEntry(key, info); + SWSS_LOG_INFO("Local learn event deleting from VXLAN table DEL_KEY %s", key.c_str()); + macDelVxlan(key); + } + } + return; }