@@ -1689,6 +1689,14 @@ struct wpa_ssid * wpa_scan_res_match(struct wpa_supplicant *wpa_s,
return NULL;
}
+#ifdef CONFIG_WNM
+ if (wnm_is_bss_excluded(wpa_s, bss)) {
+ if (debug_print)
+ wpa_dbg(wpa_s, MSG_DEBUG, " skip - BSSID excluded");
+ return NULL;
+ }
+#endif /* CONFIG_WNM */
+
for (ssid = group; ssid; ssid = only_first_ssid ? NULL : ssid->pnext) {
if (wpa_scan_res_ok(wpa_s, ssid, match_ssid, match_ssid_len,
bss, bssid_ignore_count, debug_print))
@@ -2058,3 +2058,40 @@ void wnm_clear_coloc_intf_reporting(struct wpa_supplicant *wpa_s)
wpa_s->coloc_intf_auto_report = 0;
#endif /* CONFIG_WNM */
}
+
+int wnm_is_bss_excluded(struct wpa_supplicant *wpa_s, struct wpa_bss *bss)
+{
+ /*
+ * In case disassociation imminent is set, do no try to use a BSS to
+ * which we are connected.
+ */
+ if (wpa_s->wnm_mode & WNM_BSS_TM_REQ_DISASSOC_IMMINENT) {
+ unsigned int i;
+
+ if (wpa_s->current_bss &&
+ !os_memcmp(wpa_s->current_bss->bssid,
+ bss->bssid,
+ ETH_ALEN)) {
+ wpa_dbg(wpa_s, MSG_DEBUG,
+ "WNM: disassociation imminent: current BSS");
+ return 1;
+ }
+
+ if (!wpa_s->valid_links)
+ return 0;
+
+ for (i = 0; i < MAX_NUM_MLD_LINKS; i++) {
+ if (!(wpa_s->valid_links & BIT(i)))
+ continue;
+
+ if (!os_memcmp(wpa_s->links[i].bssid,
+ bss->bssid, ETH_ALEN)) {
+ wpa_dbg(wpa_s, MSG_DEBUG,
+ "WNM: MLD: disassociation imminent");
+ return 1;
+ }
+ }
+ }
+
+ return 0;
+}
@@ -70,7 +70,7 @@ int wnm_send_coloc_intf_report(struct wpa_supplicant *wpa_s, u8 dialog_token,
const struct wpabuf *elems);
void wnm_set_coloc_intf_elems(struct wpa_supplicant *wpa_s,
struct wpabuf *elems);
-
+int wnm_is_bss_excluded(struct wpa_supplicant *wpa_s, struct wpa_bss *bss);
#ifdef CONFIG_WNM