Browse Source

Add BSSID into blacklist and do not clean blacklist during countermeasures

If scanning continues during TKIP countermeasures, try to avoid selecting
the BSS that triggered the counter measures.
Bartosz Markowski 13 years ago
parent
commit
8945cc451f
1 changed files with 5 additions and 1 deletions
  1. 5 1
      wpa_supplicant/events.c

+ 5 - 1
wpa_supplicant/events.c

@@ -788,7 +788,8 @@ wpa_supplicant_pick_network(struct wpa_supplicant *wpa_s,
 				break;
 				break;
 		}
 		}
 
 
-		if (selected == NULL && wpa_s->blacklist) {
+		if (selected == NULL && wpa_s->blacklist &&
+		    !wpa_s->countermeasures) {
 			wpa_dbg(wpa_s, MSG_DEBUG, "No APs found - clear "
 			wpa_dbg(wpa_s, MSG_DEBUG, "No APs found - clear "
 				"blacklist and try again");
 				"blacklist and try again");
 			wpa_blacklist_clear(wpa_s);
 			wpa_blacklist_clear(wpa_s);
@@ -1675,6 +1676,9 @@ wpa_supplicant_event_michael_mic_failure(struct wpa_supplicant *wpa_s,
 
 
 		/* initialize countermeasures */
 		/* initialize countermeasures */
 		wpa_s->countermeasures = 1;
 		wpa_s->countermeasures = 1;
+
+		wpa_blacklist_add(wpa_s, wpa_s->bssid);
+
 		wpa_msg(wpa_s, MSG_WARNING, "TKIP countermeasures started");
 		wpa_msg(wpa_s, MSG_WARNING, "TKIP countermeasures started");
 
 
 		/*
 		/*