Wireless Daemon for Linux
 help / color / mirror / Atom feed
* ios hotspot fix
@ 2024-03-25 17:26 Jeremy Whiting
  2024-03-25 18:23 ` James Prestwood
  0 siblings, 1 reply; 4+ messages in thread
From: Jeremy Whiting @ 2024-03-25 17:26 UTC (permalink / raw)
  To: iwd; +Cc: Edmund Smith, Alvaro Soliverez

[-- Attachment #1: Type: text/plain, Size: 1656 bytes --]

Hello,

In recent testing it has been found that when trying to connect to an ios hotspot some messages are missed by iwd. It seems to be a timing issue, doesn't happen every time, but does happen often enough to be a problem. In testing the device fails to connect more than half of the attempts.

Ed Smith has created a patch that seems to fix the problem here. I've attached the patch after rebasing on iwd master.

Here's a bit of background and explanation:

iwd has difficulty in connecting to iOS hotspots as of 2.7 (and not
fixed according to our testing as of 2.16 - latest at the time this is
done). This is because of several factors:


The iOS hotspot does not repeat its initial EAPOL challenge, where
most APs will.


The iOS hotspot is not reactive to EAPOL-Start (client request to be
challenged); it sends exactly one challenge, and then the connection
times out.


The iOS hotspot sends its challenge very quickly, more quickly than
iwd is prepared for. iwd is not ready to receive the challenge
packet before the association event is fired by the kernel's wifi
stack, but the iOS hotspot's challenge packet consistently arrives
before this.


This patch moves iwd's frame listener registration for EAPOL back to
the authenticate event fired by the kernel. At this point, the
necessary details about what kind of connection we expect to have
(e.g. are we an AP) are available, but it's not possible for any
plausible EAPOL packet to arrive yet (because authenticate requires us
to take action - EAPOL happens after association, which can't happen
before we respond to authenticate).

thanks,
Jeremy

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Register-EAPOL-frame-listeners-earlier.patch --]
[-- Type: text/x-patch, Size: 1591 bytes --]

From b19007431311e5f3fe1cd4e4149ec909c4e57ffb Mon Sep 17 00:00:00 2001
From: Ed Smith <ed.smith@collabora.com>
Date: Thu, 21 Mar 2024 21:43:57 +0000
Subject: [PATCH] Register EAPOL frame listeners earlier

If we register the main EAPOL frame listener as late as the associate
event, it may not observe ptk_1_of_4. This defeats handling for early
messages in eapol_rx_packet, which only sees messages once it has been
registered.

If we move registration to the authenticate event, then the EAPOL
frame listeners should observe all messages, without any possible
races. Note that the messages are not actually processed until
eapol_start() is called, and we haven't moved that call site. All
that's changing here is how early EAPOL messages can be observed.
---
 src/netdev.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/netdev.c b/src/netdev.c
index 09fac959..3b6e2c26 100644
--- a/src/netdev.c
+++ b/src/netdev.c
@@ -2918,6 +2918,11 @@ static void netdev_authenticate_event(struct l_genl_msg *msg,
 		return;
 	}
 
+	if (!netdev->sm) {
+		netdev->sm = eapol_sm_new(netdev->handshake);
+		eapol_register(netdev->sm);
+	}
+
 	/*
 	 * During Fast Transition we use the authenticate event to start the
 	 * reassociation step because the FTE necessary before we can build
@@ -3099,9 +3104,6 @@ static void netdev_associate_event(struct l_genl_msg *msg,
 			netdev->ap = NULL;
 		}
 
-		netdev->sm = eapol_sm_new(netdev->handshake);
-		eapol_register(netdev->sm);
-
 		/* Just in case this was a retry */
 		netdev->ignore_connect_event = false;
 
-- 
2.44.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-03-26 11:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-25 17:26 ios hotspot fix Jeremy Whiting
2024-03-25 18:23 ` James Prestwood
2024-03-25 19:11   ` Jeremy Whiting
2024-03-26 11:33     ` James Prestwood

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox