]> git.ipfire.org Git - thirdparty/hostap.git/blobdiff - wpa_supplicant/interworking.c
wpa_supplicant: Implement fast-associate on SelectNetwork
[thirdparty/hostap.git] / wpa_supplicant / interworking.c
index 019b8947c9b6815cd2b2e7896dc4682a9f484cdc..e1f58a67e1a508a0eb568d0d5bff7840145c4797 100644 (file)
@@ -54,16 +54,8 @@ static void interworking_reconnect(struct wpa_supplicant *wpa_s)
        wpa_s->disconnected = 0;
        wpa_s->reassociate = 1;
 
-       if (wpa_s->last_scan_res_used > 0) {
-               struct os_time now;
-               os_get_time(&now);
-               if (now.sec - wpa_s->last_scan.sec <= 5) {
-                       wpa_printf(MSG_DEBUG, "Interworking: Old scan results "
-                                  "are fresh - connect without new scan");
-                       if (wpas_select_network_from_last_scan(wpa_s) >= 0)
-                               return;
-               }
-       }
+       if (wpa_supplicant_fast_associate(wpa_s) >= 0)
+               return;
 
        wpa_supplicant_req_scan(wpa_s, 0, 0);
 }
@@ -1680,6 +1672,11 @@ interworking_match_anqp_info(struct wpa_supplicant *wpa_s, struct wpa_bss *bss)
                        continue;
                if (other->anqp == NULL)
                        continue;
+               if (other->anqp->roaming_consortium == NULL &&
+                   other->anqp->nai_realm == NULL &&
+                   other->anqp->anqp_3gpp == NULL &&
+                   other->anqp->domain_name == NULL)
+                       continue;
                if (!(other->flags & WPA_BSS_ANQP_FETCH_TRIED))
                        continue;
                if (os_memcmp(bss->hessid, other->hessid, ETH_ALEN) != 0)
@@ -1705,7 +1702,7 @@ static void interworking_next_anqp_fetch(struct wpa_supplicant *wpa_s)
        int found = 0;
        const u8 *ie;
 
-       if (!wpa_s->fetch_anqp_in_progress)
+       if (eloop_terminated() || !wpa_s->fetch_anqp_in_progress)
                return;
 
        dl_list_for_each(bss, &wpa_s->bss, struct wpa_bss, list) {