]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
wifi-scripts: fix macaddr lookup in utils.uc 24070/head
authorHarin Lee <me@harin.net>
Sat, 4 Jul 2026 11:04:31 +0000 (20:04 +0900)
committerJonas Jelonek <jelonek.jonas@gmail.com>
Thu, 9 Jul 2026 07:28:08 +0000 (09:28 +0200)
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 <me@harin.net>
Link: https://github.com/openwrt/openwrt/pull/24070
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
package/network/config/wifi-scripts/files/usr/share/ucode/wifi/utils.uc

index 7ecfd2d204d891b3217201d2fdb24b5d48881487..147c16205aa8dc64706bbdc17d3ae33edb20faca 100644 (file)
@@ -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) {