]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Preserve user roaming configuration across connection state changes
authorShubham Joshi <shujosh@qti.qualcomm.com>
Tue, 17 Jun 2025 05:46:48 +0000 (11:16 +0530)
committerJouni Malinen <j@w1.fi>
Mon, 23 Jun 2025 18:07:13 +0000 (21:07 +0300)
Prevent unintended roaming re-enablement after connection state
changes, even when user configuration disables it.

If user disables roaming, but after each state change post-connection,
wpa_supplicant re-enables roaming when bssid_set is false. This migh
cause the driver to send a roam enable configuration to the firmware,
overriding the user's intent.

Fix this by ensuring wpa_supplicant logic to check both bssid_set and
the user’s roaming configuration (`SET roaming`) after each connection
state change. Ensure roaming is only re-enabled if explicitly
configured, allowing the driver to maintain the intended roaming state
throughout the connection.

Fixes: e0935844724a ("STA: Update driver roaming policy on connection completion")
Signed-off-by: Shubham Joshi <shujosh@qti.qualcomm.com>
wpa_supplicant/ctrl_iface.c
wpa_supplicant/notify.c
wpa_supplicant/wpa_supplicant_i.h

index 8c81fd549c34af6d94e38f6d609c8fef3aa55054..4e0c1eda32da83006f9cfc277f5194043b5551af 100644 (file)
@@ -964,6 +964,7 @@ static int wpa_supplicant_ctrl_iface_set(struct wpa_supplicant *wpa_s,
        } else if (os_strcasecmp(cmd, "ric_ies") == 0) {
                ret = wpas_ctrl_iface_set_ric_ies(wpa_s, value);
        } else if (os_strcasecmp(cmd, "roaming") == 0) {
+               wpa_s->sta_roaming_disabled = atoi(value) ? false : true;
                ret = wpa_drv_roaming(wpa_s, atoi(value), NULL);
 #ifdef CONFIG_WNM
        } else if (os_strcasecmp(cmd, "coloc_intf_elems") == 0) {
index fd8783d25924b0282782a771511d435fbf2c6df0..0827e51dec990d98f6fd33db39fccc478647c4af 100644 (file)
@@ -108,7 +108,7 @@ void wpas_notify_state_changed(struct wpa_supplicant *wpa_s,
 
        if (new_state == WPA_COMPLETED) {
                wpas_p2p_notif_connected(wpa_s);
-               if (ssid)
+               if (ssid && !wpa_s->sta_roaming_disabled)
                        wpa_drv_roaming(wpa_s, !ssid->bssid_set,
                                        ssid->bssid_set ? ssid->bssid : NULL);
        } else if (old_state >= WPA_ASSOCIATED && new_state < WPA_ASSOCIATED) {
index 3f844aff672fb66cb76ce902512bb97fa971db3d..3b2f344445132945eacc8ed89bcc97443b08832b 100644 (file)
@@ -744,6 +744,7 @@ struct wpa_supplicant {
        } links[MAX_NUM_MLD_LINKS];
        u8 *last_con_fail_realm;
        size_t last_con_fail_realm_len;
+       bool sta_roaming_disabled;
 
        /* Selected configuration (based on Beacon/ProbeResp WPA IE) */
        int pairwise_cipher;