]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
wifi-scripts: ucode: check wpa_supplicant exists before mesh probe 23607/head
authorFlorian Maurer <fmaurer@disroot.org>
Sun, 31 May 2026 21:04:41 +0000 (21:04 +0000)
committerJonas Jelonek <jelonek.jonas@gmail.com>
Mon, 29 Jun 2026 07:26:56 +0000 (09:26 +0200)
The mesh capability check unconditionally ran wpa_supplicant -vmesh to
detect driver support. On devices where wpa_supplicant is not installed,
this produces a "/bin/sh: wpa_supplicant: not found" error in the logs
on every wifi reconfiguration even when no mesh interface is configured.

Guard the invocation with fs.access() so the binary is only executed
when it is actually present, and use its absolute path to avoid relying
on $PATH.

Signed-off-by: Florian Maurer <fmaurer@disroot.org>
Link: https://github.com/openwrt/openwrt/pull/23607
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh

index 3ed59fba16c14622e9da8183b85ee4bcaa765e52..fa924cb1db18c6ba6508d2cfd33a42b7ada39bc4 100755 (executable)
@@ -250,7 +250,7 @@ function setup() {
                                break;
                        // fallthrough
                case 'mesh':
-                       supplicant_mesh ??= !system("wpa_supplicant -vmesh");
+                       supplicant_mesh ??= (fs.access('/usr/sbin/wpa_supplicant', 'x') && !system("/usr/sbin/wpa_supplicant -vmesh"));
                        if (mode == "mesh" && !supplicant_mesh)
                                break;
                        // fallthrough