]> git.ipfire.org Git - people/stevee/network.git/commitdiff
wpa_supplicant: Support 802.11s
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 17 Aug 2017 21:52:20 +0000 (21:52 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 17 Aug 2017 21:52:20 +0000 (21:52 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/functions/functions.wpa_supplicant

index e7f36771cbdedb626fcefdd227fb15b7fe5dd395..983ef111b0c09b9f465d3bba12f56d8b4ebed204 100644 (file)
@@ -31,6 +31,7 @@ wpa_supplicant_config_write() {
        shift 2
 
        local ap_scan=1 mode key ssid
+       local channel
 
        local arg
        for arg in "$@"; do
@@ -38,6 +39,9 @@ wpa_supplicant_config_write() {
                        --ap-scan=*)
                                ap_scan=$(cli_get_val "${arg}")
                                ;;
+                       --channel=*)
+                               channel=$(cli_get_val "${arg}")
+                               ;;
                        --mode=*)
                                mode=$(cli_get_val "${arg}")
 
@@ -61,6 +65,7 @@ wpa_supplicant_config_write() {
        assert isset mode
 
        local auth_alg key_mgmt proto ssid psk wep_key0 wep_tx_keyidx
+       local operation_mode
        local country_code="$(wireless_get_reg_domain)"
 
        case "${mode}" in
@@ -115,6 +120,18 @@ wpa_supplicant_config_write() {
                        key_mgmt="IEEE8021X"
                        ;;
 
+               # IEEE 802.11s without authentication
+               802.11s)
+                       operation_mode="mesh"
+
+                       # Use SAE when we got a PSK
+                       if isset psk; then
+                               key_mgmt="SAE"
+                       else
+                               key_mgmt="NONE"
+                       fi
+                       ;;
+
                # No encryption. DANGEROUS!
                NONE)
                        auth_alg="OPEN"
@@ -166,6 +183,21 @@ wpa_supplicant_config_write() {
                        print " psk=\"${key}\""
                fi
 
+               # Operation Mode
+               case "${operation_mode}" in
+                       ibss)
+                               print " mode=1"
+                               ;;
+                       mesh)
+                               print " mode=5"
+                               ;;
+               esac
+
+               # Frequency
+               if isset channel; then
+                       print " frequency=$(wireless_channel_to_frequency "${channel}")"
+               fi
+
                if isset wep_key0; then
                        print " wep_key0=\"${wep_key0}\""
                fi