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

[teamsyncd]: Add team_ifindex2ifname return value check #500

Merged
merged 1 commit into from
May 10, 2018
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
10 changes: 9 additions & 1 deletion teamsyncd/teamsync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,19 @@ int TeamSync::TeamPortSync::onChange()
bool enabled;

ifindex = team_get_port_ifindex(port);
team_ifindex2ifname(m_team, ifindex, ifname, MAX_IFNAME);

/* Skip if interface is not found */
if (!team_ifindex2ifname(m_team, ifindex, ifname, MAX_IFNAME))
{
SWSS_LOG_INFO("Interface ifindex(%u) is not found", ifindex);
continue;
}

/* Skip the member that is removed from the LAG */
if (team_is_port_removed(port))
{
continue;
}

team_get_port_enabled(m_team, ifindex, &enabled);
tmp_lag_members[string(ifname)] = enabled;
Expand Down