]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
STA: Update driver roaming policy on connection completion
authorPurushottam Kushwaha <quic_pkushwah@quicinc.com>
Fri, 23 Aug 2024 13:23:08 +0000 (18:53 +0530)
committerJouni Malinen <j@w1.fi>
Thu, 19 Sep 2024 17:29:37 +0000 (20:29 +0300)
When the network profile is configured with BSSID before connection,
roaming policy in the driver (for driver-based BSS selection) doesn't
get updated if the same BSSID is configured after connection. Update
roaming policy to the driver on connection completion to cover this
case.

Signed-off-by: Purushottam Kushwaha <quic_pkushwah@quicinc.com>
wpa_supplicant/notify.c

index 22b75d46baa0e30b49b524e7bccefffbdf1e157a..24812ffbbdb65eca49daf3ae66b9e6e1370f8e73 100644 (file)
@@ -88,6 +88,8 @@ void wpas_notify_state_changed(struct wpa_supplicant *wpa_s,
                               enum wpa_states new_state,
                               enum wpa_states old_state)
 {
+       struct wpa_ssid *ssid = wpa_s->current_ssid;
+
        if (wpa_s->p2p_mgmt)
                return;
 
@@ -104,10 +106,14 @@ void wpas_notify_state_changed(struct wpa_supplicant *wpa_s,
        }
 #endif /* CONFIG_FST */
 
-       if (new_state == WPA_COMPLETED)
+       if (new_state == WPA_COMPLETED) {
                wpas_p2p_notif_connected(wpa_s);
-       else if (old_state >= WPA_ASSOCIATED && new_state < WPA_ASSOCIATED)
+               if (ssid)
+                       wpa_drv_roaming(wpa_s, !ssid->bssid_set,
+                                       ssid->bssid_set ? ssid->bssid : NULL);
+       } else if (old_state >= WPA_ASSOCIATED && new_state < WPA_ASSOCIATED) {
                wpas_p2p_notif_disconnected(wpa_s);
+       }
 
        sme_state_changed(wpa_s);