Skip to content

Commit

Permalink
Added LAG member check on addLagMember()
Browse files Browse the repository at this point in the history
Signed-off-by: Andriy Kokhan <andriyx.kokhan@intel.com>
  • Loading branch information
Andriy Kokhan authored and Your Name committed Sep 22, 2022
1 parent 04fbc8e commit 6bc2bda
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions cfgmgr/teammgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -716,16 +716,27 @@ task_process_status TeamMgr::addLagMember(const string &lag, const string &membe
{
SWSS_LOG_ENTER();

stringstream cmd;
string res;

// If port was already deleted, ignore this operation
cmd << IP_CMD << " link show " << shellquote(member);
if (exec(cmd.str(), res) != 0)
{
SWSS_LOG_WARN("Unable to find port %s", member.c_str());
return task_ignore;
}

// If port is already enslaved, ignore this operation
// TODO: check the current master if it is the same as to be configured
if (isPortEnslaved(member))
{
return task_ignore;
}

stringstream cmd;
string res;
uint16_t keyId = generateLacpKey(lag);
cmd.str("");
cmd.clear();

// Set admin down LAG member (required by teamd) and enslave it
// ip link set dev <member> down;
Expand Down

0 comments on commit 6bc2bda

Please sign in to comment.