wifi-scripts: fix wdev fallback for mesh interfaces
authorNick Hainke <vincent@systemli.org>
Thu, 25 Dec 2025 17:41:10 +0000 (18:41 +0100)
committerNick Hainke <vincent@systemli.org>
Sat, 27 Dec 2025 10:18:49 +0000 (11:18 +0100)
The previous wdev.uc invocation failed for mesh interfaces.
Rewrite it as a loop so the mesh interface is created correctly
when no wpa_supplicant mesh support is installed.

Link: https://github.com/openwrt/openwrt/pull/21291
Signed-off-by: Nick Hainke <vincent@systemli.org>
package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh

index 8aba81436ee296156156a2e0a07924d15505fde6..dcfdcd2cc85f442dfc4e2d8d00ac509e76e4b5d0 100755 (executable)
@@ -294,7 +294,15 @@ function setup() {
        if (fs.access('/usr/sbin/hostapd', 'x'))
                hostapd.setup(data);
 
-       system(`ucode /usr/share/hostap/wdev.uc ${data.phy}${data.phy_suffix} set_config '${printf("%J", wdev_data)}' ${join(' ', active_ifnames)}`);
+       for (let ifname in active_ifnames) {
+               if (!wdev_data[ifname])
+                       continue;
+
+               let if_config = {
+                       [ifname]: wdev_data[ifname]
+               };
+               system(`ucode /usr/share/hostap/wdev.uc ${data.phy}${data.phy_suffix} set_config '${if_config}'`);
+       }
 
        if (length(supplicant_data) > 0)
                supplicant.start(data);