diff options
author | Jouni Malinen <jouni@qca.qualcomm.com> | 2012-02-16 16:38:50 +0200 |
---|---|---|
committer | Jouni Malinen <j@w1.fi> | 2012-02-16 16:38:50 +0200 |
commit | 5ed7880d052f3e476baa9ad6a908d834c631201b (patch) | |
tree | f5dfd96a863d673b89be84b809d2357facbbf903 | |
parent | 7d86e53747a095693474e94a4f3feac3e539d79d (diff) | |
download | external_wpa_supplicant_8_ti-5ed7880d052f3e476baa9ad6a908d834c631201b.zip external_wpa_supplicant_8_ti-5ed7880d052f3e476baa9ad6a908d834c631201b.tar.gz external_wpa_supplicant_8_ti-5ed7880d052f3e476baa9ad6a908d834c631201b.tar.bz2 |
Interworking: Allow network block -based connection without ANQP matches
Previously, network block -based connection could have been used to
override ANQP-based selection. However, if no ANQP-based matches were
present, no connection was started. Fix this by trying to connect if
any enabled network block has a match in the BSS table.
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
-rw-r--r-- | wpa_supplicant/interworking.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/wpa_supplicant/interworking.c b/wpa_supplicant/interworking.c index 46a65a0..3dbdc06 100644 --- a/wpa_supplicant/interworking.c +++ b/wpa_supplicant/interworking.c @@ -17,6 +17,7 @@ #include "eap_peer/eap_methods.h" #include "wpa_supplicant_i.h" #include "config.h" +#include "config_ssid.h" #include "bss.h" #include "scan.h" #include "notify.h" @@ -973,6 +974,31 @@ static int interworking_home_sp(struct wpa_supplicant *wpa_s, } +static int interworking_find_network_match(struct wpa_supplicant *wpa_s) +{ + struct wpa_bss *bss; + struct wpa_ssid *ssid; + + dl_list_for_each(bss, &wpa_s->bss, struct wpa_bss, list) { + for (ssid = wpa_s->conf->ssid; ssid; ssid = ssid->next) { + if (ssid->disabled || ssid->mode != WPAS_MODE_INFRA) + continue; + if (ssid->ssid_len != bss->ssid_len || + os_memcmp(ssid->ssid, bss->ssid, ssid->ssid_len) != + 0) + continue; + /* + * TODO: Consider more accurate matching of security + * configuration similarly to what is done in events.c + */ + return 1; + } + } + + return 0; +} + + static void interworking_select_network(struct wpa_supplicant *wpa_s) { struct wpa_bss *bss, *selected = NULL, *selected_home = NULL; @@ -1020,6 +1046,20 @@ static void interworking_select_network(struct wpa_supplicant *wpa_s) } if (count == 0) { + /* + * No matching network was found based on configured + * credentials. Check whether any of the enabled network blocks + * have matching APs. + */ + if (interworking_find_network_match(wpa_s)) { + wpa_printf(MSG_DEBUG, "Interworking: Possible BSS " + "match for enabled network configurations"); + wpa_s->disconnected = 0; + wpa_s->reassociate = 1; + wpa_supplicant_req_scan(wpa_s, 0, 0); + return; + } + wpa_msg(wpa_s, MSG_INFO, INTERWORKING_NO_MATCH "No network " "with matching credentials found"); } |