WNM: Verify BSS TM target match against the current network profile
[mech_eap.git] / wpa_supplicant / wnm_sta.c
index 7d2a92f..f77d51a 100644 (file)
@@ -546,6 +546,17 @@ compare_scan_neighbor_results(struct wpa_supplicant *wpa_s)
                        continue;
                }
 
+               if (wpa_s->current_ssid &&
+                   !wpa_scan_res_match(wpa_s, 0, target, wpa_s->current_ssid,
+                                       1)) {
+                       wpa_printf(MSG_DEBUG, "Candidate BSS " MACSTR
+                                  " (pref %d) does not match the current network profile",
+                                  MAC2STR(nei->bssid),
+                                  nei->preference_present ? nei->preference :
+                                  -1);
+                       continue;
+               }
+
                if (wpa_is_bss_tmp_disallowed(wpa_s, target->bssid)) {
                        wpa_printf(MSG_DEBUG,
                                   "MBO: Candidate BSS " MACSTR