All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/2] station: transition to disconnected on station_free
@ 2021-04-27 23:25 James Prestwood
  2021-04-27 23:25 ` [PATCH v2 2/2] netdev: only call connect_ok in station/p2p_client mode James Prestwood
  0 siblings, 1 reply; 2+ messages in thread
From: James Prestwood @ 2021-04-27 23:25 UTC (permalink / raw
  To: iwd

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

This allows station to gracefully clean up things like the diagnostic
interface which is directly tied to stations CONNECTED/DISCONNECTED
states.
---
 src/station.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/station.c b/src/station.c
index 9c2b4e64..325175e9 100644
--- a/src/station.c
+++ b/src/station.c
@@ -3486,6 +3486,8 @@ static void station_free(struct station *station)
 	if (station->connected_bss)
 		netdev_disconnect(station->netdev, NULL, NULL);
 
+	station_enter_state(station, STATION_STATE_DISCONNECTED);
+
 	if (station->netconfig) {
 		netconfig_destroy(station->netconfig);
 		station->netconfig = NULL;
-- 
2.26.2

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

* [PATCH v2 2/2] netdev: only call connect_ok in station/p2p_client mode
  2021-04-27 23:25 [PATCH v2 1/2] station: transition to disconnected on station_free James Prestwood
@ 2021-04-27 23:25 ` James Prestwood
  0 siblings, 0 replies; 2+ messages in thread
From: James Prestwood @ 2021-04-27 23:25 UTC (permalink / raw
  To: iwd

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

netdev_connect_ok is only for station/p2p_client modes but AP
also ends up on the same code path. Check the iftype before
calling netdev_connect_ok.
---
 src/netdev.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/netdev.c b/src/netdev.c
index 252ae78a..0feb9e66 100644
--- a/src/netdev.c
+++ b/src/netdev.c
@@ -1337,7 +1337,8 @@ static void try_handshake_complete(struct netdev_handshake_state *nhs)
 		nhs->complete = true;
 		handshake_event(&nhs->super, HANDSHAKE_EVENT_COMPLETE);
 
-		netdev_connect_ok(nhs->netdev);
+		if (nhs->netdev->type == NL80211_IFTYPE_STATION)
+			netdev_connect_ok(nhs->netdev);
 	}
 }
 
-- 
2.26.2

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

end of thread, other threads:[~2021-04-27 23:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-27 23:25 [PATCH v2 1/2] station: transition to disconnected on station_free James Prestwood
2021-04-27 23:25 ` [PATCH v2 2/2] netdev: only call connect_ok in station/p2p_client mode James Prestwood

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.