From 7df3c87892e38f1d2c04d70b8c73a05fe63b3504 Mon Sep 17 00:00:00 2001 From: eraiza0816 <10572974+eraiza0816@users.noreply.github.com> Date: Wed, 9 Sep 2026 10:58:16 +0900 Subject: [PATCH] Fix counters rejection of logical port 0 --- CHANGELOG.md | 5 +++++ httpd/page_impl.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 168bd34f..a9e5a074 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/httpd/page_impl.c b/httpd/page_impl.c index b99f0b9b..e0377203 100644 --- a/httpd/page_impl.c +++ b/httpd/page_impl.c @@ -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');