aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/events.c
diff options
context:
space:
mode:
authorMasashi Honma <masashi.honma@gmail.com>2016-07-08 02:39:12 (GMT)
committerJouni Malinen <j@w1.fi>2016-07-23 18:57:11 (GMT)
commit7035162311c7a8cc503e7c915f853fbf28642307 (patch)
treeb43bcd4a0f09cfebe173202b7265d666255c13cf /wpa_supplicant/events.c
parent58fe015a320ae64a3f52e319a69dac0d433a4e03 (diff)
downloadhostap-7035162311c7a8cc503e7c915f853fbf28642307.zip
hostap-7035162311c7a8cc503e7c915f853fbf28642307.tar.gz
hostap-7035162311c7a8cc503e7c915f853fbf28642307.tar.bz2
mesh: Join an existing MBSS instead of creating a new one
If scan results show a matching existing MBSS, join it instead of creating a new MBSS. Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
Diffstat (limited to 'wpa_supplicant/events.c')
-rw-r--r--wpa_supplicant/events.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index dffba32..b94febb 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -1014,8 +1014,10 @@ struct wpa_ssid * wpa_scan_res_match(struct wpa_supplicant *wpa_s,
continue;
}
- if (!bss_is_ess(bss) && !bss_is_pbss(bss)) {
- wpa_dbg(wpa_s, MSG_DEBUG, " skip - neither ESS nor PBSS network");
+ if (ssid->mode != IEEE80211_MODE_MESH && !bss_is_ess(bss) &&
+ !bss_is_pbss(bss)) {
+ wpa_dbg(wpa_s, MSG_DEBUG,
+ " skip - not ESS, PBSS, or MBSS");
continue;
}
@@ -1624,6 +1626,14 @@ static int wpas_select_network_from_last_scan(struct wpa_supplicant *wpa_s,
selected = wpa_supplicant_pick_network(wpa_s, &ssid);
+#ifdef CONFIG_MESH
+ if (wpa_s->ifmsh) {
+ wpa_msg(wpa_s, MSG_INFO,
+ "Avoiding join because we already joined a mesh group");
+ return 0;
+ }
+#endif /* CONFIG_MESH */
+
if (selected) {
int skip;
skip = !wpa_supplicant_need_to_roam(wpa_s, selected, ssid);
@@ -1652,13 +1662,6 @@ static int wpas_select_network_from_last_scan(struct wpa_supplicant *wpa_s,
*/
return 1;
} else {
-#ifdef CONFIG_MESH
- if (wpa_s->ifmsh) {
- wpa_msg(wpa_s, MSG_INFO,
- "Avoiding join because we already joined a mesh group");
- return 0;
- }
-#endif /* CONFIG_MESH */
wpa_dbg(wpa_s, MSG_DEBUG, "No suitable network found");
ssid = wpa_supplicant_pick_new_network(wpa_s);
if (ssid) {