diff --git a/orchagent/intfsorch.cpp b/orchagent/intfsorch.cpp index 9bc36f7bb6..13683bd655 100644 --- a/orchagent/intfsorch.cpp +++ b/orchagent/intfsorch.cpp @@ -645,7 +645,7 @@ void IntfsOrch::doTask(Consumer &consumer) if(table_name == CHASSIS_APP_SYSTEM_INTERFACE_TABLE_NAME) { - if(!isRemoteSystemPortIntf(alias)) + if(isLocalSystemPortIntf(alias)) { //Synced local interface. Skip it = consumer.m_toSync.erase(it); @@ -1546,6 +1546,22 @@ bool IntfsOrch::isRemoteSystemPortIntf(string alias) return false; } +bool IntfsOrch::isLocalSystemPortIntf(string alias) +{ + Port port; + if(gPortsOrch->getPort(alias, port)) + { + if (port.m_type == Port::LAG) + { + return(port.m_system_lag_info.switch_id == gVoqMySwitchId); + } + + return(port.m_system_port_info.type != SAI_SYSTEM_PORT_TYPE_REMOTE); + } + //Given alias is system port alias of the local port/LAG + return false; +} + void IntfsOrch::voqSyncAddIntf(string &alias) { //Sync only local interface. Confirm for the local interface and diff --git a/orchagent/intfsorch.h b/orchagent/intfsorch.h index 341675bac1..18be59b454 100644 --- a/orchagent/intfsorch.h +++ b/orchagent/intfsorch.h @@ -68,6 +68,7 @@ class IntfsOrch : public Orch bool updateSyncdIntfPfx(const string &alias, const IpPrefix &ip_prefix, bool add = true); bool isRemoteSystemPortIntf(string alias); + bool isLocalSystemPortIntf(string alias); private: diff --git a/orchagent/neighorch.cpp b/orchagent/neighorch.cpp index 42bf064367..cd2dc4cd2c 100644 --- a/orchagent/neighorch.cpp +++ b/orchagent/neighorch.cpp @@ -1203,7 +1203,7 @@ void NeighOrch::doVoqSystemNeighTask(Consumer &consumer) string alias = key.substr(0, found); - if(!gIntfsOrch->isRemoteSystemPortIntf(alias)) + if(gIntfsOrch->isLocalSystemPortIntf(alias)) { //Synced local neighbor. Skip it = consumer.m_toSync.erase(it);