Skip to content

Commit a14c78a

Browse files
fengming-yecfriedt
authored andcommitted
modules: hostap: fix wifi roaming aborted in few cases
Add guard of supplicant state condition. Not send neighbor request in auth procedures. Add process for null pointer params. Signed-off-by: Fengming Ye <[email protected]>
1 parent b78be6b commit a14c78a

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

modules/hostap/src/supp_api.c

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1528,13 +1528,26 @@ int supplicant_11k_cfg(const struct device *dev, struct wifi_11k_params *params)
15281528

15291529
int supplicant_11k_neighbor_request(const struct device *dev, struct wifi_11k_params *params)
15301530
{
1531+
struct wpa_supplicant *wpa_s;
15311532
int ssid_len;
15321533

1533-
if (params == NULL) {
1534+
wpa_s = get_wpa_s_handle(dev);
1535+
if (!wpa_s) {
1536+
wpa_printf(MSG_ERROR, "Device %s not found", dev->name);
15341537
return -1;
15351538
}
15361539

1537-
ssid_len = strlen(params->ssid);
1540+
if (wpa_s->reassociate || (wpa_s->wpa_state >= WPA_AUTHENTICATING &&
1541+
wpa_s->wpa_state < WPA_COMPLETED)) {
1542+
wpa_printf(MSG_INFO, "Reassociation is in progress, skip");
1543+
return 0;
1544+
}
1545+
1546+
if (params) {
1547+
ssid_len = strlen(params->ssid);
1548+
} else {
1549+
ssid_len = 0;
1550+
}
15381551

15391552
if (ssid_len > 0) {
15401553
if (ssid_len > WIFI_SSID_MAX_LEN) {

0 commit comments

Comments
 (0)