Skip to content

Skip setting the same hwaddr to lag port to avoid disrupting neighbor… #2602

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

Merged
merged 3 commits into from
Mar 23, 2019
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
From 43e512b114176feb1828ff0a75f0224f2b219a2d Mon Sep 17 00:00:00 2001
From: Jipan Yang <[email protected]>
Date: Sun, 24 Feb 2019 00:04:15 -0800
Subject: [PATCH] Skip setting the same hwaddr to lag port to avoid disrupting
neighbor entries

Signed-off-by: Jipan Yang <[email protected]>
---
teamd/teamd.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/teamd/teamd.c b/teamd/teamd.c
index 225b8c8..e28aa7d 100644
--- a/teamd/teamd.c
+++ b/teamd/teamd.c
@@ -866,7 +866,16 @@ static int teamd_set_hwaddr(struct teamd_context *ctx)
err = -EINVAL;
goto free_hwaddr;
}
- err = team_hwaddr_set(ctx->th, ctx->ifindex, hwaddr, hwaddr_len);
+
+ if(!memcmp(hwaddr, ctx->hwaddr, hwaddr_len))
+ {
+ err = 0;
+ teamd_log_dbg("Skip setting same hwaddr string: \"%s\".", hwaddr_str);
+ }
+ else
+ {
+ err = team_hwaddr_set(ctx->th, ctx->ifindex, hwaddr, hwaddr_len);
+ }
if (!err)
ctx->hwaddr_explicit = true;
free_hwaddr:
--
2.9.2

1 change: 1 addition & 0 deletions src/libteam/series
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
0004-libteam-Add-lacp-fallback-support-for-single-member-.patch
0005-libteam-Add-warm_reboot-mode.patch
0006-Fix-ifinfo_link_with_port-race-condition-with-newlink.patch
0007-Skip-setting-the-same-hwaddr-to-lag-port-to-avoid-di.patch