wifi-scripts: fix failing mesh setup with missing wpa_supplicant
authorDavid Bauer <mail@david-bauer.net>
Thu, 12 Dec 2024 15:36:50 +0000 (16:36 +0100)
committerDavid Bauer <mail@david-bauer.net>
Thu, 12 Dec 2024 15:40:14 +0000 (16:40 +0100)
The initialization of mesh interfaces currently fail when wpa_supplicant
is not installed. This is due to the script calling the wpa_supplicant
feature indicator without verifying wpa_supplicant is installed at all.

To avoid failing, first check if wpa_supplicant is installed before
determining the available featureset.

Signed-off-by: David Bauer <mail@david-bauer.net>
package/network/config/wifi-scripts/files/lib/netifd/wireless/mac80211.sh

index c835b46e759a77af9224eb840923492efcaa8ad2..1fb3edf0558d303453ad42c2d26bb2b705ab3bbe 100755 (executable)
@@ -1023,7 +1023,7 @@ mac80211_setup_vif() {
                        json_get_vars $MP_CONFIG_INT $MP_CONFIG_BOOL $MP_CONFIG_STRING
                        wireless_vif_parse_encryption
                        [ -z "$htmode" ] && htmode="NOHT";
-                       if wpa_supplicant -vmesh; then
+                       if [ -x /usr/sbin/wpa_supplicant ] && wpa_supplicant -vmesh; then
                                mac80211_setup_supplicant || failed=1
                        else
                                mac80211_setup_mesh