diff --git a/src/netdev.c b/src/netdev.c index e639a1f8..dadd90da 100644 --- a/src/netdev.c +++ b/src/netdev.c @@ -4394,6 +4394,9 @@ int netdev_reassociate(struct netdev *netdev, const struct scan_bss *target_bss, struct handshake_state *old_hs; struct eapol_sm *old_sm; + if (netdev->connect_cmd_id || netdev->work.id) + return -EBUSY; + old_sm = netdev->sm; old_hs = netdev->handshake; diff --git a/src/station.c b/src/station.c index 8fcf8c70..e3aeb3fd 100644 --- a/src/station.c +++ b/src/station.c @@ -2598,6 +2598,7 @@ static void station_preauthenticate_cb(struct netdev *netdev, if (station_transition_reassociate(station, bss, new_hs) < 0) { handshake_state_unref(new_hs); station_roam_failed(station); + return; } handshake_state_unref(station->hs); @@ -3272,8 +3273,7 @@ static void station_ap_directed_roam(struct station *station, uint16_t dtimer; uint8_t valid_interval; bool can_roam = !station_cannot_roam(station); - bool ignore_candidates = - station->connected_bss->vendor_quirks.ignore_bss_tm_candidates; + bool ignore_candidates; l_debug("ifindex: %u", netdev_get_ifindex(station->netdev)); @@ -3282,6 +3282,9 @@ static void station_ap_directed_roam(struct station *station, return; } + ignore_candidates = + station->connected_bss->vendor_quirks.ignore_bss_tm_candidates; + /* * Sanitize the frame to check that it is from our current AP. *