diff mbox series

[2/2] station: check if authentication is supported via CMD_FRAME

Message ID 20241011145503.51330-2-prestwoj@gmail.com (mailing list archive)
State New
Headers show
Series [1/2] wiphy: parse TX/RX frame types, and API to check auth frame support | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
prestwoj/iwd-ci-gitlint success GitLint

Commit Message

James Prestwood Oct. 11, 2024, 2:55 p.m. UTC
If the driver does not support this don't allow FT-over-Air as
CMD_FRAME will fail. This will downgrade the roam to reassociation.
In the future IWD could instead use CMD_AUTHENTICATE, but thats a
larger change. This will at least get these drivers functioning
better.
---
 src/station.c | 31 +++++++++++++++++++++++--------
 1 file changed, 23 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/src/station.c b/src/station.c
index 9ebed8e2..b7905c4f 100644
--- a/src/station.c
+++ b/src/station.c
@@ -2162,14 +2162,29 @@  static bool station_can_fast_transition(struct station *station,
 			return false;
 	}
 
-	/*
-	 * FT-over-Air in its current form relies on CMD_REMAIN_ON_CHANNEL. Some
-	 * drivers do not support this so only allow over-DS if this is the case
-	 */
-	if (!(hs->mde[4] & 1) &&
-			!wiphy_supports_cmd_offchannel(station->wiphy)) {
-		l_debug("FT-over-Air needs offchannel, using reassociation");
-		return false;
+	if (!(hs->mde[4] & 1)) {
+		/*
+		 * FT-over-Air in its current form relies on
+		 * CMD_REMAIN_ON_CHANNEL. Some drivers do not support this so
+		 * only allow over-DS if this is the case
+		 */
+		if (!wiphy_supports_cmd_offchannel(station->wiphy)) {
+			l_debug("FT-over-Air needs offchannel, using "
+				"reassociation");
+			return false;
+		}
+
+		/*
+		 * TODO: if drivers don't support TX/RX of auth frames via
+		 *       CMD_FRAME IWD could choose to use CMD_AUTHENTICATE
+		 *       instead. For now just avoid FT roaming and let these
+		 *       drivers roam via reassociation.
+		 */
+		if (!wiphy_supports_auth_frame(station->wiphy)) {
+			l_debug("FT-over-Air needs CMD_FRAME auth, using "
+				"reassociation");
+			return false;
+		}
 	}
 
 	return true;