sonic-swss
sonic-swss copied to clipboard
[SWSS:portsorch] missing child_ports checking in addLagMember and removeLagMember when setting interface strip tag
in addLagMember and removeLagMember, it needs to check if the interface has child port, besides current checking on lag.m_bridge_port_id.
The issue is seen when a LAG member is added after sub interface creating, the interface strip tag is not set as expected. cause the member is not working for packet with vlan_id.
I will create a PR to fix it.
@@ -7031,12 +7035,15 @@ bool PortsOrch::addLagMember(Port &lag, Port &port, string member_status)
m_portList[lag.m_alias] = lag;
- if (lag.m_bridge_port_id > 0)
+ if ((lag.m_bridge_port_id > 0)||(!lag.m_child_ports.empty()))
{
@@ -7079,7 +7086,8 @@ bool PortsOrch::removeLagMember(Port &lag, Port &port)
lag.m_members.erase(port.m_alias);
m_portList[lag.m_alias] = lag;
- if (lag.m_bridge_port_id > 0)
+ if ((lag.m_bridge_port_id > 0)||(!lag.m_child_ports.empty()))