Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[teammgr] Added LAG member check into addLagMember() #2464

Merged
merged 1 commit into from
Nov 1, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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