Skip to content

Commit

Permalink
teamd: lacp: increase "min_ports" upper limit to 1024
Browse files Browse the repository at this point in the history
Signed-off-by: Jiri Pirko <[email protected]>
  • Loading branch information
Jiri Pirko committed Feb 22, 2021
1 parent 267f248 commit 69a7494
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion man/teamd.conf.5
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion teamd/teamd_runner_lacp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 69a7494

Please sign in to comment.