All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] station: handle ROAMING state in disconnect event
@ 2022-09-27 23:15 James Prestwood
  2022-09-27 23:15 ` [PATCH 2/3] ft: clear ft_info inside offchannel destroy James Prestwood
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: James Prestwood @ 2022-09-27 23:15 UTC (permalink / raw)
  To: iwd; +Cc: James Prestwood

This both adds proper handling to the new roaming logic and fixes
a potential bug with firmware roams.

The new way roaming works doesn't use a connect callback. This
means that any disconnect event or call to netdev_connect_failed
will result in the event handler being called, where before the
connect callback would. This means we need to handle the ROAMING
state in the station disconnect event so IWD properly disassociates
and station goes out of ROAMING.

With firmware roams netdev gets an event which transitions station
into ROAMING. Then netdev issues GET_SCAN. During this time a
disconnect event could come in which would end up in
station_disconnect_event since there is no connect callback. This
needs to be handled the same and let IWD transition out of the
ROAMING state.
---
 src/station.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/station.c b/src/station.c
index 4e07ef19..c3f3b383 100644
--- a/src/station.c
+++ b/src/station.c
@@ -3172,6 +3172,7 @@ static void station_disconnect_event(struct station *station, void *event_data)
 					event_data, station);
 		return;
 	case STATION_STATE_CONNECTED:
+	case STATION_STATE_ROAMING:
 		station_disassociated(station);
 		return;
 	default:
-- 
2.34.3


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

* [PATCH 2/3] ft: clear ft_info inside offchannel destroy
  2022-09-27 23:15 [PATCH 1/3] station: handle ROAMING state in disconnect event James Prestwood
@ 2022-09-27 23:15 ` James Prestwood
  2022-09-27 23:15 ` [PATCH 3/3] ft: fix ft_associate to verify if authentication succeeded James Prestwood
  2022-09-28 17:34 ` [PATCH 1/3] station: handle ROAMING state in disconnect event Denis Kenzior
  2 siblings, 0 replies; 4+ messages in thread
From: James Prestwood @ 2022-09-27 23:15 UTC (permalink / raw)
  To: iwd; +Cc: James Prestwood

Once offchannel completes we can check if the info structure was
parsed, indicating authentication succeeded. If not there is no
reason to keep it around since IWD will either try another BSS or
fail.
---
 src/ft.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/src/ft.c b/src/ft.c
index 72c42309..5b53810a 100644
--- a/src/ft.c
+++ b/src/ft.c
@@ -960,18 +960,17 @@ void __ft_rx_authenticate(uint32_t ifindex, const uint8_t *frame,
 					&status, &ies, &ies_len))
 		return;
 
-	/* Verified to be expected target, offchannel can be canceled */
-	offchannel_cancel(netdev_get_wdev_id(netdev), info->offchannel_id);
-
 	if (status != 0)
-		return;
+		goto cancel;
 
 	if (!ft_parse_ies(info, hs, ies, ies_len))
-		return;
+		goto cancel;
 
 	info->parsed = true;
 
-	return;
+cancel:
+	/* Verified to be expected target, offchannel can be canceled */
+	offchannel_cancel(netdev_get_wdev_id(netdev), info->offchannel_id);
 }
 
 static void ft_send_authenticate(void *user_data)
@@ -1007,6 +1006,11 @@ static void ft_authenticate_destroy(int error, void *user_data)
 	struct ft_info *info = user_data;
 
 	info->offchannel_id = 0;
+
+	if (!info->parsed) {
+		l_queue_remove(info_list, info);
+		ft_info_destroy(info);
+	}
 }
 
 /*
-- 
2.34.3


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

* [PATCH 3/3] ft: fix ft_associate to verify if authentication succeeded
  2022-09-27 23:15 [PATCH 1/3] station: handle ROAMING state in disconnect event James Prestwood
  2022-09-27 23:15 ` [PATCH 2/3] ft: clear ft_info inside offchannel destroy James Prestwood
@ 2022-09-27 23:15 ` James Prestwood
  2022-09-28 17:34 ` [PATCH 1/3] station: handle ROAMING state in disconnect event Denis Kenzior
  2 siblings, 0 replies; 4+ messages in thread
From: James Prestwood @ 2022-09-27 23:15 UTC (permalink / raw)
  To: iwd; +Cc: James Prestwood

ft_associate was only checking the presence of the info structure,
not if it actually succeeded to authenticate.
---
 src/ft.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/ft.c b/src/ft.c
index 5b53810a..cc13d2bf 100644
--- a/src/ft.c
+++ b/src/ft.c
@@ -1055,7 +1055,7 @@ int ft_associate(uint32_t ifindex, const uint8_t *addr)
 	 *       a different BSS.
 	 */
 	info = ft_info_find(ifindex, addr);
-	if (!info)
+	if (!info || !info->parsed)
 		return -ENOENT;
 
 	ft_prepare_handshake(info, hs);
-- 
2.34.3


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

* Re: [PATCH 1/3] station: handle ROAMING state in disconnect event
  2022-09-27 23:15 [PATCH 1/3] station: handle ROAMING state in disconnect event James Prestwood
  2022-09-27 23:15 ` [PATCH 2/3] ft: clear ft_info inside offchannel destroy James Prestwood
  2022-09-27 23:15 ` [PATCH 3/3] ft: fix ft_associate to verify if authentication succeeded James Prestwood
@ 2022-09-28 17:34 ` Denis Kenzior
  2 siblings, 0 replies; 4+ messages in thread
From: Denis Kenzior @ 2022-09-28 17:34 UTC (permalink / raw)
  To: James Prestwood, iwd

Hi James,

On 9/27/22 18:15, James Prestwood wrote:
> This both adds proper handling to the new roaming logic and fixes
> a potential bug with firmware roams.
> 
> The new way roaming works doesn't use a connect callback. This
> means that any disconnect event or call to netdev_connect_failed
> will result in the event handler being called, where before the
> connect callback would. This means we need to handle the ROAMING
> state in the station disconnect event so IWD properly disassociates
> and station goes out of ROAMING.
> 
> With firmware roams netdev gets an event which transitions station
> into ROAMING. Then netdev issues GET_SCAN. During this time a
> disconnect event could come in which would end up in
> station_disconnect_event since there is no connect callback. This
> needs to be handled the same and let IWD transition out of the
> ROAMING state.
> ---
>   src/station.c | 1 +
>   1 file changed, 1 insertion(+)
> 

All applied, thanks.

Regards,
-Denis


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

end of thread, other threads:[~2022-09-28 17:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-27 23:15 [PATCH 1/3] station: handle ROAMING state in disconnect event James Prestwood
2022-09-27 23:15 ` [PATCH 2/3] ft: clear ft_info inside offchannel destroy James Prestwood
2022-09-27 23:15 ` [PATCH 3/3] ft: fix ft_associate to verify if authentication succeeded James Prestwood
2022-09-28 17:34 ` [PATCH 1/3] station: handle ROAMING state in disconnect event Denis Kenzior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.