[PATCH] wifi-scripts: wdev.uc: Fix mesh mode frequency handling
Valent@MeshPoint
valent at meshpointone.com
Fri Jan 2 15:58:37 PST 2026
Hi,
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:
1. Adding freq validation check similar to adhoc mode
2. Making freq and htmode optional in the mesh join command
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)
Discovered while testing my custom L3 mesh routing protocol with
mesh_fwding=0.
Signed-off-by: Valent Turkovic <valent at meshpointone.com>
---
package/network/config/wifi-scripts/files/usr/share/hostap/wdev.uc | 14
++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
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 xxxxxxx..yyyyyyy 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
@@ -38,10 +38,16 @@ function iface_start(wdev)
system(cmd);
} else if (wdev.mode == "mesh") {
- let cmd = [ "iw", "dev", ifname, "mesh", "join", wdev.ssid,
"freq", wdev.freq, htmode ];
- for (let key in [ "basic-rates", "mcast-rate",
"beacon-interval" ])
- if (wdev[key])
- push(cmd, key, wdev[key]);
+ 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]);
+ }
system(cmd);
wdev_set_mesh_params(ifname, wdev);
--
2.39.0
More information about the openwrt-devel
mailing list