Skip to contentSkip to conversation

station: transition to disconnected on station_free

PATCH Superseded James Prestwood 1 participant 2 messages Apr 27, 2021

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 station: transition to disconnected on station_free

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(+)
src/station.c +2 -0
index 9c2b4e64..325175e9 100644
@@ -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;
Signature · 1 line
2.26.2
#1 lore raw

PATCH v2 2/2 netdev: only call connect_ok in station/p2p_client mode

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(-)
src/netdev.c +2 -1
index 252ae78a..0feb9e66 100644
@@ -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);
 	}
 }
 
Signature · 1 line
2.26.2