From aeddd9ce749dea07d19ae759bbb34ee97cc0b643 Mon Sep 17 00:00:00 2001 From: Aleksandr Gumroian Date: Thu, 29 Sep 2022 18:20:25 +0200 Subject: [PATCH 1/2] 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; } From 003606cb8c1b58b46fcadbd23a43319606cf3b37 Mon Sep 17 00:00:00 2001 From: Aleksandr Gumroian Date: Thu, 1 Dec 2022 17:13:44 +0100 Subject: [PATCH 2/2] Update Snapshots --- .../__snapshots__/WiFiSettings.test.js.snap | 50 ++++++++++++++----- 1 file changed, 37 insertions(+), 13 deletions(-) diff --git a/src/common/WiFiSettings/__tests__/__snapshots__/WiFiSettings.test.js.snap b/src/common/WiFiSettings/__tests__/__snapshots__/WiFiSettings.test.js.snap index 3b2fdf0..d66d559 100644 --- a/src/common/WiFiSettings/__tests__/__snapshots__/WiFiSettings.test.js.snap +++ b/src/common/WiFiSettings/__tests__/__snapshots__/WiFiSettings.test.js.snap @@ -337,7 +337,7 @@ exports[` Snapshot guest network. 1`] = ` - First value + Second value -@@ -500,10 +500,92 @@ +@@ -524,10 +524,92 @@ > Enables Wi-Fi for guests, which is separated from LAN network. Devices connected to this network are allowed to access the internet, but aren't allowed to access other devices and the configuration interface of the router. Parameters of the guest network can be set in the Guest network tab. @@ -347,7 +347,7 @@ exports[` Snapshot guest network. 1`] = ` + class=\\"form-group\\" + > + @@ -356,7 +356,7 @@ exports[` Snapshot guest network. 1`] = ` + > + @@ -386,7 +386,7 @@ exports[` Snapshot guest network. 1`] = ` + class=\\"form-group\\" + > + @@ -396,7 +396,7 @@ exports[` Snapshot guest network. 1`] = ` + Snapshot guest network. 1`] = ` class=\\"form-group switch\\" >
@@ -449,7 +449,7 @@ exports[` Snapshot one module enabled. 1`] = ` - First value + Second value -@@ -22,10 +22,488 @@ +@@ -22,10 +22,512 @@ Wi-Fi 1 @@ -537,7 +537,7 @@ exports[` Snapshot one module enabled. 1`] = ` + class=\\"form-group\\" + > +
+ Snapshot one module enabled. 1`] = ` + for=\\"6\\" + > + Hide SSID -+ -+ If set, network is not visible when scanning for available networks. -+ + ++ ++ If set, network is not visible when scanning for available networks. ++ +
+
+
Snapshot one module enabled. 1`] = ` + class=\\"custom-control-label\\" + for=\\"11\\" + > ++ Disable Management Frame Protection ++ ++ ++ In case you have trouble connecting to WiFi Access Point, try disabling Management Frame Protection. ++ ++
++ ++
++
++ ++ +