Skip to content

Commit 6f1e216

Browse files
nxf58150cfriedt
authored andcommitted
hostap: Ignore duplicate 11v and legacy roaming requests
Ignore duplicate 11v and legacy roaming requests if roaming is in progress. This fix can avoid multiple auth or reassociate, which are triggered by duplicate roaming requests. Signed-off-by: Hui Bai <[email protected]>
1 parent a9ddbf7 commit 6f1e216

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

modules/hostap/src/supp_api.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1800,9 +1800,25 @@ int supplicant_bss_ext_capab(const struct device *dev, int capab)
18001800

18011801
int supplicant_legacy_roam(const struct device *dev)
18021802
{
1803+
struct wpa_supplicant *wpa_s;
18031804
int ret = -1;
18041805

18051806
k_mutex_lock(&wpa_supplicant_mutex, K_FOREVER);
1807+
1808+
wpa_s = get_wpa_s_handle(dev);
1809+
if (!wpa_s) {
1810+
ret = -1;
1811+
wpa_printf(MSG_ERROR, "Interface %s not found", dev->name);
1812+
goto out;
1813+
}
1814+
1815+
if (wpa_s->reassociate || (wpa_s->wpa_state >= WPA_AUTHENTICATING &&
1816+
wpa_s->wpa_state < WPA_COMPLETED)) {
1817+
wpa_printf(MSG_INFO, "Reassociation is in progress, skip");
1818+
ret = 0;
1819+
goto out;
1820+
}
1821+
18061822
if (!wpa_cli_cmd_v("scan")) {
18071823
goto out;
18081824
}
@@ -1830,6 +1846,13 @@ int supplicant_btm_query(const struct device *dev, uint8_t reason)
18301846
goto out;
18311847
}
18321848

1849+
if (wpa_s->reassociate || (wpa_s->wpa_state >= WPA_AUTHENTICATING &&
1850+
wpa_s->wpa_state < WPA_COMPLETED)) {
1851+
wpa_printf(MSG_INFO, "Reassociation is in progress, skip");
1852+
ret = 0;
1853+
goto out;
1854+
}
1855+
18331856
if (!wpa_cli_cmd_v("wnm_bss_query %d", reason)) {
18341857
goto out;
18351858
}

0 commit comments

Comments
 (0)