aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiri Pirko <jiri@nvidia.com>2021-02-22 08:37:42 +0100
committerJiri Pirko <jiri@nvidia.com>2021-02-22 08:38:24 +0100
commit69a7494bb77dc10bb27076add07b380dbd778592 (patch)
tree69659fd00c4336477878459ffd4467ab050a9fd1
parent267f24839536234ca621d4fd0466d3b57cb6dccd (diff)
downloadlibteam-69a7494bb77dc10bb27076add07b380dbd778592.tar.gz
teamd: lacp: increase "min_ports" upper limit to 1024
Signed-off-by: Jiri Pirko <jiri@nvidia.com>
-rw-r--r--man/teamd.conf.52
-rw-r--r--teamd/teamd_runner_lacp.c3
2 files changed, 3 insertions, 2 deletions
diff --git a/man/teamd.conf.5 b/man/teamd.conf.5
index 350ffc9..dc913cd 100644
--- a/man/teamd.conf.5
+++ b/man/teamd.conf.5
@@ -248,7 +248,7 @@ Default:
.RE
.TP
.BR "runner.min_ports " (int)
-Specifies the minimum number of ports that must be active before asserting carrier in the master interface, value can be 1 \(en 255.
+Specifies the minimum number of ports that must be active before asserting carrier in the master interface, value can be 1 \(en 1024.
.RS 7
.PP
Default:
diff --git a/teamd/teamd_runner_lacp.c b/teamd/teamd_runner_lacp.c
index f524be2..2bb1a80 100644
--- a/teamd/teamd_runner_lacp.c
+++ b/teamd/teamd_runner_lacp.c
@@ -148,6 +148,7 @@ struct lacp {
#define LACP_CFG_DFLT_FAST_RATE false
int min_ports;
#define LACP_CFG_DFLT_MIN_PORTS 1
+#define LACP_CFG_DFLT_MIN_PORTS_MAX 1024
enum lacp_agg_select_policy agg_select_policy;
#define LACP_CFG_DFLT_AGG_SELECT_POLICY LACP_AGG_SELECT_LACP_PRIO
} cfg;
@@ -283,7 +284,7 @@ static int lacp_load_config(struct teamd_context *ctx, struct lacp *lacp)
err = teamd_config_int_get(ctx, &tmp, "$.runner.min_ports");
if (err) {
lacp->cfg.min_ports = LACP_CFG_DFLT_MIN_PORTS;
- } else if (tmp < 1 || tmp > UCHAR_MAX) {
+ } else if (tmp < 1 || tmp > LACP_CFG_DFLT_MIN_PORTS_MAX) {
teamd_log_err("\"min_ports\" value is out of its limits.");
return -EINVAL;
} else {