aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/events.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2012-09-27 14:36:59 (GMT)
committerJouni Malinen <j@w1.fi>2012-09-27 14:36:59 (GMT)
commit6407f4132f9691f6f1263245e531000b73aa5862 (patch)
tree163873ba8fd48004f10372fbe28527bc41dfbcd9 /wpa_supplicant/events.c
parent39b1572c41b76c059ac0390aa57eac87ad1a0d99 (diff)
downloadhostap-6407f4132f9691f6f1263245e531000b73aa5862.zip
hostap-6407f4132f9691f6f1263245e531000b73aa5862.tar.gz
hostap-6407f4132f9691f6f1263245e531000b73aa5862.tar.bz2
Add disallow_aps parameter to disallow BSSIDs/SSIDs
External programs can use this new parameter to prevent wpa_supplicant from connecting to a list of BSSIDs and/or SSIDs. The disallowed BSSes will still be visible in scan results and it is possible to run ANQP operations with them, but BSS selection for connection will skip any BSS that matches an entry in the disallowed list. The new parameter can be set with the control interface SET command using following syntax: SET disallow_aps <disallow_list> disallow_list ::= <ssid_spec> | <bssid_spec> | <disallow_list> | “” SSID_SPEC ::= ssid <SSID_HEX> BSSID_SPEC ::= bssid <BSSID_HEX> For example: wpa_cli set disallow_list "ssid 74657374 bssid 001122334455 ssid 68656c6c6f" wpa_cli set disallow_list (the empty value removes all entries) Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'wpa_supplicant/events.c')
-rw-r--r--wpa_supplicant/events.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index d696ad1..5399f76 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -84,6 +84,12 @@ static int wpa_supplicant_select_config(struct wpa_supplicant *wpa_s)
return -1;
}
+ if (disallowed_bssid(wpa_s, wpa_s->bssid) ||
+ disallowed_ssid(wpa_s, ssid->ssid, ssid->ssid_len)) {
+ wpa_dbg(wpa_s, MSG_DEBUG, "Selected BSS is disallowed");
+ return -1;
+ }
+
res = wpas_temp_disabled(wpa_s, ssid);
if (res > 0) {
wpa_dbg(wpa_s, MSG_DEBUG, "Selected network is temporarily "
@@ -672,6 +678,16 @@ static struct wpa_ssid * wpa_scan_res_match(struct wpa_supplicant *wpa_s,
return NULL;
}
+ if (disallowed_bssid(wpa_s, bss->bssid)) {
+ wpa_dbg(wpa_s, MSG_DEBUG, " skip - BSSID disallowed");
+ return NULL;
+ }
+
+ if (disallowed_ssid(wpa_s, bss->ssid, bss->ssid_len)) {
+ wpa_dbg(wpa_s, MSG_DEBUG, " skip - SSID disallowed");
+ return NULL;
+ }
+
wpa = wpa_ie_len > 0 || rsn_ie_len > 0;
for (ssid = group; ssid; ssid = ssid->pnext) {