Skip to content

Commit db44223

Browse files
jipanyangtiantianlv
authored andcommitted
[libteam]: Skip setting the same hwaddr to lag port to avoid disrupting neighbor… (sonic-net#2602)
* Skip setting the same hwaddr to lag port to avoid disrupting neighbor entries Signed-off-by: Jipan Yang <[email protected]>
1 parent 213f629 commit db44223

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
From 43e512b114176feb1828ff0a75f0224f2b219a2d Mon Sep 17 00:00:00 2001
2+
From: Jipan Yang <[email protected]>
3+
Date: Sun, 24 Feb 2019 00:04:15 -0800
4+
Subject: [PATCH] Skip setting the same hwaddr to lag port to avoid disrupting
5+
neighbor entries
6+
7+
Signed-off-by: Jipan Yang <[email protected]>
8+
---
9+
teamd/teamd.c | 11 ++++++++++-
10+
1 file changed, 10 insertions(+), 1 deletion(-)
11+
12+
diff --git a/teamd/teamd.c b/teamd/teamd.c
13+
index 225b8c8..e28aa7d 100644
14+
--- a/teamd/teamd.c
15+
+++ b/teamd/teamd.c
16+
@@ -866,7 +866,16 @@ static int teamd_set_hwaddr(struct teamd_context *ctx)
17+
err = -EINVAL;
18+
goto free_hwaddr;
19+
}
20+
- err = team_hwaddr_set(ctx->th, ctx->ifindex, hwaddr, hwaddr_len);
21+
+
22+
+ if(!memcmp(hwaddr, ctx->hwaddr, hwaddr_len))
23+
+ {
24+
+ err = 0;
25+
+ teamd_log_dbg("Skip setting same hwaddr string: \"%s\".", hwaddr_str);
26+
+ }
27+
+ else
28+
+ {
29+
+ err = team_hwaddr_set(ctx->th, ctx->ifindex, hwaddr, hwaddr_len);
30+
+ }
31+
if (!err)
32+
ctx->hwaddr_explicit = true;
33+
free_hwaddr:
34+
--
35+
2.9.2
36+

src/libteam/series

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
0004-libteam-Add-lacp-fallback-support-for-single-member-.patch
55
0005-libteam-Add-warm_reboot-mode.patch
66
0006-Fix-ifinfo_link_with_port-race-condition-with-newlink.patch
7+
0007-Skip-setting-the-same-hwaddr-to-lag-port-to-avoid-di.patch

0 commit comments

Comments
 (0)