[openwrt/openwrt] ramips: fix reading mac address for hiwifi hc5962

LEDE Commits lede-commits at lists.infradead.org
Mon Mar 17 08:22:54 PDT 2025


hauke pushed a commit to openwrt/openwrt.git, branch openwrt-24.10:
https://git.openwrt.org/a748c1af757aef53e2e781c61db7eafed0a27c66

commit a748c1af757aef53e2e781c61db7eafed0a27c66
Author: Tianling Shen <cnsztl at immortalwrt.org>
AuthorDate: Sun Mar 2 20:06:49 2025 +0800

    ramips: fix reading mac address for hiwifi hc5962
    
    The spaces in variables have been stripped since commit 551e04f3c9c0
    ("base-files: strip space and tab characters from ASCII mac address"),
    resulting "Vfac_mac " matches nothing. Fix the issue by removing the
    space at end.
    
    Signed-off-by: Tianling Shen <cnsztl at immortalwrt.org>
    Link: https://github.com/openwrt/openwrt/pull/18150
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
    (cherry picked from commit 2091c29578ca99b468e79695149be6f4b6cccb36)
---
 target/linux/ramips/mt7621/base-files/etc/board.d/02_network            | 2 +-
 .../ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
index 8d94cd592d..2374d5f60a 100644
--- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
@@ -266,7 +266,7 @@ ramips_setup_macs()
 		wan_mac=$label_mac
 		;;
 	hiwifi,hc5962)
-		lan_mac=$(mtd_get_mac_ascii bdinfo "Vfac_mac ")
+		lan_mac=$(mtd_get_mac_ascii bdinfo "Vfac_mac")
 		label_mac=$lan_mac
 		[ -n "$lan_mac" ] || lan_mac=$(cat /sys/class/net/eth0/address)
 		wan_mac=$(macaddr_add "$lan_mac" 1)
diff --git a/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
index 4a056623ab..05e4ebe99a 100644
--- a/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
+++ b/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
@@ -103,7 +103,7 @@ case "$board" in
 			macaddr_setbit_la "$(mtd_get_mac_binary factory 0x4)" > /sys${DEVPATH}/macaddress
 		;;
 	hiwifi,hc5962)
-		label_mac=$(mtd_get_mac_ascii bdinfo "Vfac_mac ")
+		label_mac=$(mtd_get_mac_ascii bdinfo "Vfac_mac")
 		[ "$PHYNBR" = "0" ] && [ -n "$label_mac" ] && \
 		echo -n "$label_mac" > /sys${DEVPATH}/macaddress
 		[ "$PHYNBR" = "1" ] && [ -n "$label_mac" ] && \




More information about the lede-commits mailing list