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 <me@harin.net>
Link: https://github.com/openwrt/openwrt/pull/24070
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
This commit is contained in:
Harin Lee 2026-07-04 20:04:31 +09:00 committed by Jonas Jelonek
parent b519bc3b76
commit b664ec8ab1
No known key found for this signature in database

View 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) {