]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
HS 2.0: Allow CANCEL_FETCH_OSU to stop at scan completion
authorJouni Malinen <j@w1.fi>
Sun, 14 Dec 2014 00:14:29 +0000 (02:14 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 14 Dec 2014 00:28:03 +0000 (02:28 +0200)
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>
wpa_supplicant/hs20_supplicant.c
wpa_supplicant/interworking.c
wpa_supplicant/wpa_supplicant_i.h

index d91a936273cd3bb204b47c659a6375af0ab34664..9eb5064625e858f0b91de5cdc5529384bc1a07aa 100644 (file)
@@ -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;
index 8c4ea3468dbd8bf198748b1cd569bf08d0b42a45..116df052888cc55482a866c4ee5af2b892face40 100644 (file)
@@ -2530,6 +2530,7 @@ static void interworking_next_anqp_fetch(struct wpa_supplicant *wpa_s)
        if (found == 0) {
                if (wpa_s->fetch_osu_info) {
                        if (wpa_s->num_prov_found == 0 &&
+                           wpa_s->fetch_osu_waiting_scan &&
                            wpa_s->num_osu_scans < 3) {
                                wpa_printf(MSG_DEBUG, "HS 2.0: No OSU providers seen - try to scan again");
                                hs20_start_osu_scan(wpa_s);
index 8370e54198984a93c6a3093c93c380bd56a426f3..e0c7cd6cf11fdd9bc50b3bc72655a950c61dce90 100644 (file)
@@ -852,6 +852,7 @@ struct wpa_supplicant {
        unsigned int auto_network_select:1;
        unsigned int fetch_all_anqp:1;
        unsigned int fetch_osu_info:1;
+       unsigned int fetch_osu_waiting_scan:1;
        unsigned int fetch_osu_icon_in_progress:1;
        struct wpa_bss *interworking_gas_bss;
        unsigned int osu_icon_id;