From 05b803cb7674aee9eb68bada5be4e149689c3fe8 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Tue, 30 Jun 2020 10:35:47 -0500 Subject: [PATCH] station: reflow station_roam_failed If the roam failed and we are no longer connected, station_disassociated is called which ends up calling station_roam_state_clear. Thus resetting the variables is not needed. Reflow the logic to make this a bit more explicit. --- src/station.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/station.c b/src/station.c index a022b6ac..f6ed0fe3 100644 --- a/src/station.c +++ b/src/station.c @@ -1364,22 +1364,26 @@ static void station_roamed(struct station *station) static void station_roam_failed(struct station *station) { + l_debug("%u", netdev_get_ifindex(station->netdev)); + + /* + * If we attempted a reassociation or a fast transition, and ended up + * here then we are now disconnected. + */ + if (station->state == STATION_STATE_ROAMING) { + station_disassociated(station); + return; + } + /* * If we're still connected to the old BSS, only clear preparing_roam * and reattempt in 60 seconds if signal level is still low at that - * time. Otherwise (we'd already started negotiating with the - * transition target, preparing_roam is false, state is roaming) we - * are now disconnected. + * time. */ - - l_debug("%u", netdev_get_ifindex(station->netdev)); - station->preparing_roam = false; station->ap_directed_roaming = false; - if (station->state == STATION_STATE_ROAMING) - station_disassociated(station); - else if (station->signal_low) + if (station->signal_low) station_roam_timeout_rearm(station, 60); }