802.11s: fix authsae support in netifd
[openwrt/openwrt.git] / package / kernel / mac80211 / files / lib / netifd / wireless / mac80211.sh
index c5d34824995a2fd8116ef67e61b066023079dc9e..53d1cb9c8ff532a9f3abcc711a32f956ec431930 100644 (file)
@@ -449,6 +449,7 @@ mac80211_setup_adhoc() {
 
 mac80211_setup_vif() {
        local name="$1"
+       local failed
 
        json_select data
        json_get_vars ifname
@@ -473,7 +474,19 @@ mac80211_setup_vif() {
                                json_get_var mp_val "$var"
                                [ -n "$mp_val" ] && iw dev "$ifname" set mesh_param "$var" "$mp_val"
                        done
-                       # todo: authsae
+
+                       # authsae
+                       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
+                                       json_select ..
+                                       return
+                               fi
+                       fi
                ;;
                adhoc)
                        wireless_vif_parse_encryption