From 9fc60a91b5ad2d25fa867791f16bb9dbaad8a8e5 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 13 May 2021 01:42:20 +0200 Subject: [PATCH] gluon-web-private-wifi: add support for 802.11r Add support for enabling IEEE 802.11r Fast BSS transitioning on WPA2-PSK networks. With PSK2 networks, the PMK can be derived from the PSK, thus all information for generating is available to the AP without performing PMK exchanges with other APs. Thus, we can offer a simple configuration to potnetial users. --- .../config-mode/model/admin/privatewifi.lua | 30 +++++++++++++------ 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/package/gluon-web-private-wifi/luasrc/lib/gluon/config-mode/model/admin/privatewifi.lua b/package/gluon-web-private-wifi/luasrc/lib/gluon/config-mode/model/admin/privatewifi.lua index a3b80432..c9bb4e9c 100644 --- a/package/gluon-web-private-wifi/luasrc/lib/gluon/config-mode/model/admin/privatewifi.lua +++ b/package/gluon-web-private-wifi/luasrc/lib/gluon/config-mode/model/admin/privatewifi.lua @@ -1,4 +1,6 @@ local uci = require("simple-uci").cursor() +local unistd = require 'posix.unistd' + local platform = require 'gluon.platform' local wireless = require 'gluon.wireless' @@ -45,6 +47,12 @@ if platform.device_supports_mfp(uci) then end mfp.default = uci:get('wireless', primary_iface, 'ieee80211w') or "0" +local ieee80211r = nil +if unistd.access('/lib/gluon/features/wpa3') then + ieee80211r = s:option(Flag, "80211r", translate("Fast BSSID transition")) + ieee80211r:depends(encryption, "psk2") + ieee80211r.default = uci:get('wireless', primary_iface, 'ieee80211r') or false +end function f:write() wireless.foreach_radio(uci, function(radio, index) @@ -56,17 +64,21 @@ function f:write() local macaddr = wireless.get_wlan_mac(uci, radio, index, 4) uci:section('wireless', 'wifi-iface', name, { - device = radio_name, - network = 'wan', - mode = 'ap', - encryption = encryption.data, - ssid = ssid.data, - key = key.data, - macaddr = macaddr, - ifname = suffix and 'wan' .. suffix, - disabled = false, + device = radio_name, + network = 'wan', + mode = 'ap', + encryption = encryption.data, + ssid = ssid.data, + key = key.data, + macaddr = macaddr, + ifname = suffix and 'wan' .. suffix, + disabled = false, }) + if ieee80211r ~= nil then + uci:set('wireless', name, 'ieee80211r', ieee80211r.data) + end + -- hostapd-mini won't start in case 802.11w is configured if platform.device_supports_mfp(uci) then uci:set('wireless', name, 'ieee80211w', mfp.data)