[OpenWrt-Devel,PATCH/RFC,2/2] mac80211: allow encrypted mesh with wpa_supplicant
diff mbox

Message ID 20150202004339.GA3927@makrotopia.org
State Superseded
Delegated to: Felix Fietkau
Headers show

Commit Message

Daniel Golle Feb. 2, 2015, 12:43 a.m. UTC
authsae is still prefered if installed.
---
 .../mac80211/files/lib/netifd/wireless/mac80211.sh     | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

Patch
diff mbox

diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
index 72f9936..8d641e4 100644
--- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
+++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
@@ -596,23 +596,27 @@  mac80211_setup_vif() {
 
 	case "$mode" in
 		mesh)
-			for var in $MP_CONFIG_INT $MP_CONFIG_BOOL $MP_CONFIG_STRING; do
-				json_get_var mp_val "$var"
-				[ -n "$mp_val" ] && iw dev "$ifname" set mesh_param "$var" "$mp_val"
-			done
-
-			# authsae
+			# authsae or wpa_supplicant
 			json_get_vars key
 			if [ -n "$key" ]; then
 				if [ -e "/lib/wifi/authsae.sh" ]; then
 					. /lib/wifi/authsae.sh
 					authsae_start_interface || failed=1
 				else
-					wireless_setup_vif_failed AUTHSAE_NOT_INSTALLED
+					wireless_vif_parse_encryption
+					mac80211_setup_supplicant || failed=1
+				fi
+				if [ $failed = 1 ]; then
+					wireless_setup_vif_failed MESH_SAE_FAILED
 					json_select ..
 					return
 				fi
 			fi
+
+			for var in $MP_CONFIG_INT $MP_CONFIG_BOOL $MP_CONFIG_STRING; do
+				json_get_var mp_val "$var"
+				[ -n "$mp_val" ] && iw dev "$ifname" set mesh_param "$var" "$mp_val"
+			done
 		;;
 		adhoc)
 			wireless_vif_parse_encryption