path: root/wpa_supplicant/scan.c
diff options
authorJouni Malinen <j@w1.fi>2014-01-02 21:03:31 (GMT)
committerJouni Malinen <j@w1.fi>2014-01-02 21:03:31 (GMT)
commit949938aadf54735f29c340caf667e7505840b3c7 (patch)
treeaacfeedfced0f7ba25e0af3578ab4a499264c673 /wpa_supplicant/scan.c
parenta1a31b6c3f9f87f87e232a819065042c85092726 (diff)
Ask driver to report only new scan results if requested
If the BSS table within wpa_supplicant is flushed, request the driver to flush its own scan result table during the next scan. This can avoid unexpected old BSS entries showing up after BSS_FLUSH or FLUSH command in cases where the driver may maintain its internal cache of scan results (e.g., cfg80211 BSS table persists at least for 15 seconds). In addition to doing this automatically on BSS_FLUSH/FLUSH, a new SCAN command argument, only_new=1, can be used to request a manual scan request to do same. Though, it should be noted that this maintains the BSS table within wpa_supplicant. BSS_FLUSH followed by SCAN command can be used to clear all BSS entries from both the driver and wpa_supplicant. Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpa_supplicant/scan.c')
1 files changed, 7 insertions, 0 deletions
diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c
index 34c430f..167ab9d 100644
--- a/wpa_supplicant/scan.c
+++ b/wpa_supplicant/scan.c
@@ -155,6 +155,8 @@ int wpa_supplicant_trigger_scan(struct wpa_supplicant *wpa_s,
wpa_supplicant_notify_scanning(wpa_s, 1);
+ if (wpa_s->clear_driver_scan_cache)
+ params->only_new_results = 1;
ret = wpa_drv_scan(wpa_s, params);
if (ret) {
wpa_supplicant_notify_scanning(wpa_s, 0);
@@ -164,6 +166,7 @@ int wpa_supplicant_trigger_scan(struct wpa_supplicant *wpa_s,
wpa_s->own_scan_requested = 1;
+ params->only_new_results = 0;
return ret;
@@ -727,6 +730,10 @@ ssid_list_set:
wpa_supplicant_optimize_freqs(wpa_s, &params);
extra_ie = wpa_supplicant_extra_ies(wpa_s);
+ if (wpa_s->last_scan_req == MANUAL_SCAN_REQ &&
+ wpa_s->manual_scan_only_new)
+ params.only_new_results = 1;
if (wpa_s->last_scan_req == MANUAL_SCAN_REQ && params.freqs == NULL &&
wpa_s->manual_scan_freqs) {
wpa_dbg(wpa_s, MSG_DEBUG, "Limit manual scan to specified channels");