diff --git a/cmd_parser.c b/cmd_parser.c index 8798e8be..4fc2b0cf 100644 --- a/cmd_parser.c +++ b/cmd_parser.c @@ -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 | ...))\n"); + print_string("Error: lag (show | <1-4> (d | ...))\n"); } diff --git a/doc/link_aggregation.md b/doc/link_aggregation.md index 6bde787e..b725e419 100644 --- a/doc/link_aggregation.md +++ b/doc/link_aggregation.md @@ -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 [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 [p2]... + Create or set a LAG. LAG-ID is 1 to 4. Ports are physical ports. + +> lag d + Delete the LAG. > lag show Shows information on all 4 lags