From b664ec8ab174e935db98f271ab0eecb032d01a7e Mon Sep 17 00:00:00 2001 From: Harin Lee Date: Sat, 4 Jul 2026 20:04:31 +0900 Subject: [PATCH] wifi-scripts: fix macaddr lookup in utils.uc This fixes a simple logic error of the macaddr lookup in utils.uc. It read from the wrong sysfs file and compared it without trimming. Signed-off-by: Harin Lee Link: https://github.com/openwrt/openwrt/pull/24070 Signed-off-by: Jonas Jelonek --- .../config/wifi-scripts/files/usr/share/ucode/wifi/utils.uc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/network/config/wifi-scripts/files/usr/share/ucode/wifi/utils.uc b/package/network/config/wifi-scripts/files/usr/share/ucode/wifi/utils.uc index 7ecfd2d204d..147c16205aa 100644 --- a/package/network/config/wifi-scripts/files/usr/share/ucode/wifi/utils.uc +++ b/package/network/config/wifi-scripts/files/usr/share/ucode/wifi/utils.uc @@ -8,7 +8,7 @@ function phy_filename(phy, name) { } function phy_file(phy, name) { - return readfile(phy_filename(phy, name)); + return trim(readfile(phy_filename(phy, name))); } function phy_index(phy) { @@ -33,7 +33,7 @@ function __find_phy_by_path(phys, path) { function find_phy_by_macaddr(phys, macaddr) { macaddr = lc(macaddr); - return filter(phys, (phy) => phy_file(phy, "macaddr") == macaddr)[0]; + return filter(phys, (phy) => phy_file(phy, "macaddress") == macaddr)[0]; } function rename_phy_by_name(phys, name, rename) { -- 2.47.3