aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/hs20_supplicant.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2014-12-14 00:14:29 (GMT)
committerJouni Malinen <j@w1.fi>2014-12-14 00:28:03 (GMT)
commit568475b70b2662d613832cfcb04d9125d3649e5e (patch)
treeb34ff6c0bcda875a80d4ee2ea7d70fba6f549fa6 /wpa_supplicant/hs20_supplicant.c
parentea27f66292c9c589d97a60229b26a49dae53988c (diff)
downloadhostap-568475b70b2662d613832cfcb04d9125d3649e5e.zip
hostap-568475b70b2662d613832cfcb04d9125d3649e5e.tar.gz
hostap-568475b70b2662d613832cfcb04d9125d3649e5e.tar.bz2
HS 2.0: Allow CANCEL_FETCH_OSU to stop at scan completion
There is no need to start the GAS/ANQP fetch if the FETCH_OSU operation has already been canceled. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpa_supplicant/hs20_supplicant.c')
-rw-r--r--wpa_supplicant/hs20_supplicant.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/wpa_supplicant/hs20_supplicant.c b/wpa_supplicant/hs20_supplicant.c
index d91a936..9eb5064 100644
--- a/wpa_supplicant/hs20_supplicant.c
+++ b/wpa_supplicant/hs20_supplicant.c
@@ -831,6 +831,10 @@ static void hs20_osu_scan_res_handler(struct wpa_supplicant *wpa_s,
struct wpa_scan_results *scan_res)
{
wpa_printf(MSG_DEBUG, "OSU provisioning fetch scan completed");
+ if (!wpa_s->fetch_osu_waiting_scan) {
+ wpa_printf(MSG_DEBUG, "OSU fetch have been canceled");
+ return;
+ }
wpa_s->network_select = 0;
wpa_s->fetch_all_anqp = 1;
wpa_s->fetch_osu_info = 1;
@@ -879,6 +883,7 @@ int hs20_fetch_osu(struct wpa_supplicant *wpa_s)
void hs20_start_osu_scan(struct wpa_supplicant *wpa_s)
{
+ wpa_s->fetch_osu_waiting_scan = 1;
wpa_s->num_osu_scans++;
wpa_s->scan_req = MANUAL_SCAN_REQ;
wpa_s->scan_res_handler = hs20_osu_scan_res_handler;
@@ -890,6 +895,7 @@ void hs20_cancel_fetch_osu(struct wpa_supplicant *wpa_s)
{
wpa_printf(MSG_DEBUG, "Cancel OSU fetch");
interworking_stop_fetch_anqp(wpa_s);
+ wpa_s->fetch_osu_waiting_scan = 0;
wpa_s->network_select = 0;
wpa_s->fetch_osu_info = 0;
wpa_s->fetch_osu_icon_in_progress = 0;