From 032a3d147356386b57c644c7a4dc6644da609a1a Mon Sep 17 00:00:00 2001 From: Andrew Zaborowski Date: Thu, 16 Jun 2022 02:02:19 +0200 Subject: [PATCH] station: Move netconfig_reset() to common path To avoid repetition, call netconfig_reset in station_reset_connection_state. --- src/station.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/station.c b/src/station.c index 7c88f266..e5972269 100644 --- a/src/station.c +++ b/src/station.c @@ -1623,6 +1623,9 @@ static void station_reset_connection_state(struct station *station) station_roam_state_clear(station); + if (station->netconfig) + netconfig_reset(station->netconfig); + /* Refresh the ordered network list */ network_rank_update(station->connected_network, false); l_queue_remove(station->networks_sorted, station->connected_network); @@ -1655,9 +1658,6 @@ static void station_disassociated(struct station *station) { l_debug("%u", netdev_get_ifindex(station->netdev)); - if (station->netconfig) - netconfig_reset(station->netconfig); - station_reset_connection_state(station); station_enter_state(station, STATION_STATE_DISCONNECTED); @@ -3096,9 +3096,6 @@ static void station_disconnect_onconnect(struct station *station, return; } - if (station->netconfig) - netconfig_reset(station->netconfig); - station_reset_connection_state(station); station_enter_state(station, STATION_STATE_DISCONNECTING); @@ -3402,9 +3399,6 @@ int station_disconnect(struct station *station) if (!station->connected_bss) return -ENOTCONN; - if (station->netconfig) - netconfig_reset(station->netconfig); - /* * If the disconnect somehow fails we won't know if we're still * connected so we may as well indicate now that we're no longer