diff --git a/cmd_parser.c b/cmd_parser.c index e7daa9e8..e16fa108 100644 --- a/cmd_parser.c +++ b/cmd_parser.c @@ -846,9 +846,14 @@ void parse_mirror(void) if (cmd_words_len < 2) goto err; + // The first argument is the mirroring (monitor) port + uint8_t ret = cmd_parse_port(cmd_words_b[1]); + if (ret == 0) + goto err; + mirroring_port = atoi_results_u8; + uint8_t w = 2; uint8_t port; - uint8_t ret; while (w < cmd_words_len) { uint8_t idx = cmd_words_b[w++]; ret = cmd_parse_port(idx); @@ -858,10 +863,6 @@ void parse_mirror(void) idx += ret; port = atoi_results_u8; - // Use the first port argument as mirroring_port - if (w == 2) - mirroring_port = port; - ret = cmd_buffer[idx]; uint16_t pmask = ((uint16_t)1) << port; if (ret != 't')