Fix counters rejection of logical port 0

This commit is contained in:
eraiza0816 committed 2026-09-09 10:58:16 +09:00
1 parent af4101f060
commit 7df3c87892
2 files changed
+6 -1

No files matched your search

+5
View File
@@ -8,6 +8,11 @@
## Fixed
- Web UI
- `/counters.json` rejects physical port 1 on 9-port devices.
A mapped logical port of `0` was treated as invalid,
but it is a valid port there.
## Breaking changes
- Config
+1 -1
View File
@@ -302,7 +302,7 @@ bool send_counters(uint8_t phys_port)
if (phys_port_idx > 8)
goto err;
uint8_t log_port = machine.phys_to_log_port[phys_port_idx];
if (log_port == 0)
if (log_port < machine.min_port || log_port > machine.max_port)
goto err;
dbg_string("send_counters called: "); dbg_byte(phys_port_idx); dbg_char('\n');