In loadbalance runner, when a port with no carrier is added, the port's
'enabled' option should have been set false, so that it can change to
other ports to send the packet.
This patch is to fix it by checking it in lb's watch_ops .port_added().
Signed-off-by: Xin Long <lucien.xin(a)gmail.com>
---
teamd/teamd_runner_loadbalance.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/teamd/teamd_runner_loadbalance.c b/teamd/teamd_runner_loadbalance.c
index 43b07af..a1e2130 100644
--- a/teamd/teamd_runner_loadbalance.c
+++ b/teamd/teamd_runner_loadbalance.c
@@ -40,6 +40,15 @@ static int lb_event_watch_port_added(struct teamd_context *ctx,
tdport->ifname);
return err;
}
+
+ if (!team_is_port_link_up(tdport->team_port)) {
+ err = team_set_port_enabled(ctx->th, tdport->ifindex, false);
+ if (err) {
+ teamd_log_err("%s: Failed to disable port.",
+ tdport->ifname);
+ return TEAMD_ENOENT(err) ? 0 : err;
+ }
+ }
return teamd_balancer_port_added(lb->tb, tdport);
}
--
2.1.0