]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Supply the connection scan results to bgscan after init
authorYoni Divinsky <yoni.divinsky@ti.com>
Fri, 17 Aug 2012 17:53:44 +0000 (20:53 +0300)
committerJouni Malinen <j@w1.fi>
Fri, 17 Aug 2012 17:53:44 +0000 (20:53 +0300)
If bgscan is enabled, then bgscan is initiated after the connection,
with no bss scan result information. Since a scan was performed prior to
the connection, the information exists and can be used to initialize the
bgscan's cache.

Signed-hostap: Yoni Divinsky <yoni.divinsky@ti.com>

wpa_supplicant/wpa_supplicant.c

index 99454c407b26321389e767cb0a19e05ddb5879fb..aa0e578f25578a3bed13586224755fecbab6d47a 100644 (file)
@@ -558,8 +558,16 @@ static void wpa_supplicant_start_bgscan(struct wpa_supplicant *wpa_s)
                         * optimization, so the initial connection is not
                         * affected.
                         */
-               } else
+               } else {
+                       struct wpa_scan_results *scan_res;
                        wpa_s->bgscan_ssid = wpa_s->current_ssid;
+                       scan_res = wpa_supplicant_get_scan_results(wpa_s, NULL,
+                                                                  0);
+                       if (scan_res) {
+                               bgscan_notify_scan(wpa_s, scan_res);
+                               wpa_scan_results_free(scan_res);
+                       }
+               }
        } else
                wpa_s->bgscan_ssid = NULL;
 }