Team send gratuitous ARP with wrong src mac
by Hangbin Liu
Hi Jiri,
In libteam teamd/teamd_runner_activebackup.c, when there is a failover,
function ab_set_active_port() will enable port first and set new hwaddr later.
Sometimes the gratuitous ARP will be sent before the new hwaddr be set on team.
This will cause the ARP src mac address is still using the old hwaddr. Here is
the code.
libteam team_set_port_enabled():
- team_port_enable()
- team_notify_peers()
- team_notify_peers_work()
- call_netdevice_notifiers(NETDEV_NOTIFY_PEERS, team->dev)
- inetdev_send_gratuitous_arp(dev, in_dev);
ab->hwaddr_policy->active_set(ctx, ab, tdport)
Do you think if we should move the hwaddr setting before enabling ports?
I just a little warry about what we should do if hwaddr setting pass but the
port enable failed.
WDYT?
Thanks
Hangbin
2 years, 8 months
[patch libteam] teamd: increase the waitting time for daemon killing
by Hangbin Liu
In the current code, we wait for at most 5s when kill the daemon pid.
But in some environment, it may need more time. Then the teamd -k will
failed and return error "Failed to kill daemon: Timer expired".
Let's increase the value to have enough time. Here is the reuslt with
this patch:
$ time libteam/teamd/teamd -k -t team0
real 0m10.442s
user 0m0.017s
sys 0m0.016s
Signed-off-by: Hangbin Liu <liuhangbin(a)gmail.com>
---
teamd/teamd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/teamd/teamd.c b/teamd/teamd.c
index 9360cbf..b310140 100644
--- a/teamd/teamd.c
+++ b/teamd/teamd.c
@@ -1858,7 +1858,7 @@ int main(int argc, char **argv)
break;
case DAEMON_CMD_KILL:
if (daemon_pid_file_is_running() > 0) {
- err = daemon_pid_file_kill_wait(SIGTERM, 5);
+ err = daemon_pid_file_kill_wait(SIGTERM, 30);
if (err)
teamd_log_warn("Failed to kill daemon: %s",
strerror(errno));
--
2.26.2
2 years, 8 months