Skip to content

Commit

Permalink
Validate LAG has members before mirror session create (#2130)
Browse files Browse the repository at this point in the history
* Validate LAG has members before mirror session create
  • Loading branch information
rupesh-k authored Mar 25, 2022
1 parent 1e4d4ce commit 2bef62b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions orchagent/mirrororch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ bool MirrorOrch::validateSrcPortList(const string& srcPortList)
if (port.m_type == Port::LAG)
{
vector<Port> portv;
int portCount = 0;
m_portsOrch->getLagMember(port, portv);
for (const auto p : portv)
{
Expand All @@ -336,6 +337,13 @@ bool MirrorOrch::validateSrcPortList(const string& srcPortList)
p.m_alias.c_str(), port.m_alias.c_str(), srcPortList.c_str());
return false;
}
portCount++;
}
if (!portCount)
{
SWSS_LOG_ERROR("Source LAG %s is empty. set mirror session to inactive",
port.m_alias.c_str());;
return false;
}
}
}
Expand Down

0 comments on commit 2bef62b

Please sign in to comment.