mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-10-29 17:54:14 +08:00
cmd: parse the port of an eee command from the start of the word
parse_eee() sniffs word 2 for a trailing 'g' or 'm' to tell a speed from a port number, and advances idx past the digits to do so. The port branch then hands that advanced idx to cmd_parse_port_separator(), which expects the first character of the number and finds the separator instead, so it returns 0 and the command is rejected. Every other caller passes cmd_words_b[]. The result is that no eee command carrying a port number works, in any argument order, and the stored per-port lines a saved configuration replays are silently dropped. Reported by tofurky in issue #459, along with this fix.
This commit is contained in:
1 parent
0cc09e4015
commit
0631c813e2
1 file changed
+1
-1
+1
-1
@@ -1419,7 +1419,7 @@ void parse_eee(void)
|
||||
speed_word = 2;
|
||||
} else if (cmd_is_space_or_nul(idx)) {
|
||||
// Word 2 is a port number
|
||||
if (cmd_parse_port_separator(idx) == 0) {
|
||||
if (cmd_parse_port_separator(cmd_words_b[2]) == 0) {
|
||||
cmd_error("Speed word invalid, use: [100m|1g|2g5]\n");
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user