From aeddd9ce749dea07d19ae759bbb34ee97cc0b643 Mon Sep 17 00:00:00 2001 From: Aleksandr Gumroian Date: Thu, 29 Sep 2022 18:20:25 +0200 Subject: [PATCH] Add a switch to disable Management Frame Protection (802.11w) In the case of WPA3 encryption Management Frame Protection is enabled by default in OpenWrt. But in some cases, it causes trouble with particular devices that fails to connect to WiFi Access Point - see: https://forum.turris.cz/t/turris-omnia-wifi-health/15704/15 --- src/common/WiFiSettings/WiFiForm.js | 29 ++++++++++++++++++++----- src/common/WiFiSettings/WiFiSettings.js | 4 ++++ 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/src/common/WiFiSettings/WiFiForm.js b/src/common/WiFiSettings/WiFiForm.js index 7539045..35f52d7 100644 --- a/src/common/WiFiSettings/WiFiForm.js +++ b/src/common/WiFiSettings/WiFiForm.js @@ -8,7 +8,6 @@ import React from "react"; import PropTypes from "prop-types"; import { Switch } from "../../bootstrap/Switch"; -import { CheckBox } from "../../bootstrap/CheckBox"; import { PasswordInput } from "../../bootstrap/PasswordInput"; import { RadioSet } from "../../bootstrap/RadioSet"; import { Select } from "../../bootstrap/Select"; @@ -65,6 +64,7 @@ DeviceForm.propTypes = { guest_wifi: PropTypes.object.isRequired, encryption: PropTypes.string.isRequired, available_bands: PropTypes.array.isRequired, + ieee80211w_disabled: PropTypes.bool.isRequired, }), formErrors: PropTypes.object.isRequired, setFormValue: PropTypes.func.isRequired, @@ -102,7 +102,7 @@ function DeviceForm({ switchHeading {...props} /> - {formData.enabled ? ( + {formData.enabled && ( <> - + {(formData.encryption === "WPA3" || + formData.encryption === "WPA2/3") && ( + ({ + devices: { + [deviceIndex]: { + ieee80211w_disabled: { $set: value }, + }, + }, + }))} + {...props} + /> + )} + {hasGuestNetwork && ( )} - ) : null} - {divider ?
: null} + )} + {divider &&
} ); } diff --git a/src/common/WiFiSettings/WiFiSettings.js b/src/common/WiFiSettings/WiFiSettings.js index d97ba7a..217e242 100644 --- a/src/common/WiFiSettings/WiFiSettings.js +++ b/src/common/WiFiSettings/WiFiSettings.js @@ -59,6 +59,10 @@ function prepDataToSubmit(formData) { if (!device.guest_wifi.enabled) formData.devices[idx].guest_wifi = { enabled: false }; + + if (device.encryption === "WPA2") { + delete formData.devices[idx].ieee80211w_disabled; + } }); return formData; }