[openwrt/openwrt] wifi-scripts: create the wlan object in board_data if not present

LEDE Commits lede-commits at lists.infradead.org
Tue Feb 13 10:27:17 PST 2024


nbd pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/2a2abed0be6078368b7dc6b7730794b481d32a0e

commit 2a2abed0be6078368b7dc6b7730794b481d32a0e
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Tue Feb 13 19:24:53 2024 +0100

    wifi-scripts: create the wlan object in board_data if not present
    
    Fixes an error in wifi detection
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 .../network/config/wifi-scripts/files/usr/share/hostap/wifi-detect.uc  | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/package/network/config/wifi-scripts/files/usr/share/hostap/wifi-detect.uc b/package/network/config/wifi-scripts/files/usr/share/hostap/wifi-detect.uc
index 86ec3431ea..5f375880d2 100644
--- a/package/network/config/wifi-scripts/files/usr/share/hostap/wifi-detect.uc
+++ b/package/network/config/wifi-scripts/files/usr/share/hostap/wifi-detect.uc
@@ -39,8 +39,9 @@ function cleanup() {
 }
 
 function wiphy_get_entry(phy, path) {
-	let wlan = board_data.wlan;
+	board_data.wlan ??= {};
 
+	let wlan = board_data.wlan;
 	for (let name in wlan)
 		if (wlan[name].path == path)
 			return wlan[name];




More information about the lede-commits mailing list