From: Shubham Joshi Date: Tue, 17 Jun 2025 05:46:48 +0000 (+0530) Subject: Preserve user roaming configuration across connection state changes X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=96f5ab644f2437cc2e9be1d26b2635165aea9461;p=thirdparty%2Fhostap.git Preserve user roaming configuration across connection state changes 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 --- diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c index 8c81fd549..4e0c1eda3 100644 --- a/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant/ctrl_iface.c @@ -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) { diff --git a/wpa_supplicant/notify.c b/wpa_supplicant/notify.c index fd8783d25..0827e51de 100644 --- a/wpa_supplicant/notify.c +++ b/wpa_supplicant/notify.c @@ -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) { diff --git a/wpa_supplicant/wpa_supplicant_i.h b/wpa_supplicant/wpa_supplicant_i.h index 3f844aff6..3b2f34444 100644 --- a/wpa_supplicant/wpa_supplicant_i.h +++ b/wpa_supplicant/wpa_supplicant_i.h @@ -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;