From: Valent Turkovic Date: Sat, 3 Jan 2026 08:50:16 +0000 (+0100) Subject: wifi-scripts: wdev.uc: fix mesh mode frequency handling X-Git-Tag: v25.12.0-rc2~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b52a3124db2e5e41f9df77aa5459ccbd616af4cf;p=thirdparty%2Fopenwrt.git wifi-scripts: wdev.uc: fix mesh mode frequency handling Mesh mode interface creation fails when the freq parameter is empty or undefined. Unlike adhoc mode which checks if freq exists before using it, mesh mode blindly constructs the iw command with freq parameter, resulting in invalid syntax like: iw dev mesh0 mesh join ssid freq NOHT This causes the mesh interface to be created without joining the mesh network, leaving it in a DOWN state with no channel assigned. Fix by adding freq validation check similar to adhoc mode. Tested on two routers in parallel as mesh peers: - Xiaomi AX3000T (MediaTek MT7981) - OpenWrt One (MediaTek MT7981) - OpenWrt 6.6.119, 802.11s mesh on 5GHz (Channel 36, HE80) Signed-off-by: Valent Turkovic Link: https://github.com/openwrt/openwrt/pull/21373 Signed-off-by: Hauke Mehrtens (cherry picked from commit 7214acd7599a25863d6185a036d878b593b4b16c) --- diff --git a/package/network/config/wifi-scripts/files/usr/share/hostap/wdev.uc b/package/network/config/wifi-scripts/files/usr/share/hostap/wdev.uc index 166e9403dfc..a4f9bf7b844 100644 --- a/package/network/config/wifi-scripts/files/usr/share/hostap/wdev.uc +++ b/package/network/config/wifi-scripts/files/usr/share/hostap/wdev.uc @@ -44,7 +44,12 @@ function iface_start(wdev) push(cmd, key, wdev[key]); system(cmd); } else if (wdev.mode == "mesh") { - let cmd = [ "iw", "dev", ifname, "mesh", "join", wdev.ssid, "freq", wdev.freq, htmode ]; + let cmd = [ "iw", "dev", ifname, "mesh", "join", wdev.ssid ]; + if (wdev.freq) { + push(cmd, "freq", wdev.freq); + if (htmode && htmode != "NOHT") + push(cmd, htmode); + } for (let key in [ "basic-rates", "mcast-rate", "beacon-interval" ]) if (wdev[key]) push(cmd, key, wdev[key]);