lag: address review, single arg-count check and "d" only

Fold the "group with no ports" case into the argument-count guard
(cmd_words_len < 3) instead of a separate check, and accept only "d" for
delete, dropping the longer "delete" spelling. Update the serial-console
docs to match.
This commit is contained in:
d00f committed 2026-09-06 18:41:27 +02:00
1 parent ecac6d1934
commit 078a446cee
2 files changed
+8 -9

No files matched your search

+3 -6
View File
@@ -395,7 +395,7 @@ void parse_lag(void)
return;
}
if (cmd_words_len < 2)
if (cmd_words_len < 3)
goto err;
// Parse group, expect only one number 0-9;
@@ -406,10 +406,7 @@ void parse_lag(void)
if (group > 3)
goto err;
if (cmd_words_len == 2)
goto err;
if (cmd_compare(2, "delete") || cmd_compare(2, "d")) {
if (cmd_compare(2, "d")) {
port_lag_members_set(group, 0);
return;
}
@@ -425,7 +422,7 @@ void parse_lag(void)
port_lag_members_set(group, members);
return;
err:
print_string("Error: lag (show | <1-4> (delete | <port>...))\n");
print_string("Error: lag (show | <1-4> (d | <port>...))\n");
}
+5 -3
View File
@@ -48,9 +48,11 @@ void port_lag_hash_set(__xdata uint8_t lag, __xdata uint8_t hash_bits) __banked;
## LAG configuration on the Serial Console
For testing the following commands are provided on the serial console:
```
> lag <LAG-ID> [p1] [p2]...
Create or set a LAG. Trunk-ID is 1 or 2. Ports are physical ports
If only the LAG-ID is given but no members, the LAG is deleted
> lag <LAG-ID> <p1> [p2]...
Create or set a LAG. LAG-ID is 1 to 4. Ports are physical ports.
> lag <LAG-ID> d
Delete the LAG.
> lag show
Shows information on all 4 lags