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:
parent
b519bc3b76
commit
b664ec8ab1
1 changed files with 2 additions and 2 deletions
|
|
@ -8,7 +8,7 @@ function phy_filename(phy, name) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function phy_file(phy, name) {
|
function phy_file(phy, name) {
|
||||||
return readfile(phy_filename(phy, name));
|
return trim(readfile(phy_filename(phy, name)));
|
||||||
}
|
}
|
||||||
|
|
||||||
function phy_index(phy) {
|
function phy_index(phy) {
|
||||||
|
|
@ -33,7 +33,7 @@ function __find_phy_by_path(phys, path) {
|
||||||
|
|
||||||
function find_phy_by_macaddr(phys, macaddr) {
|
function find_phy_by_macaddr(phys, macaddr) {
|
||||||
macaddr = lc(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) {
|
function rename_phy_by_name(phys, name, rename) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue