[libteam]: Skip setting the same hwaddr to lag port to avoid disrupting neighbor… (#2602)
* Skip setting the same hwaddr to lag port to avoid disrupting neighbor entries Signed-off-by: Jipan Yang <jipan.yang@alibaba-inc.com>
This commit is contained in:
parent
800d20bf1a
commit
4e3bb4d47a
@ -0,0 +1,36 @@
|
||||
From 43e512b114176feb1828ff0a75f0224f2b219a2d Mon Sep 17 00:00:00 2001
|
||||
From: Jipan Yang <jipan.yang@alibaba-inc.com>
|
||||
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 <jipan.yang@alibaba-inc.com>
|
||||
---
|
||||
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
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user