diff mbox

[2/4] wpa_supplicant: Do not expire scan results based on aborted scan

Message ID 1444814793-21050-2-git-send-email-ilan.peer@intel.com
State Accepted
Headers show

Commit Message

Peer, Ilan Oct. 14, 2015, 9:26 a.m. UTC
From: Avraham Stern <avraham.stern@intel.com>

Do not expire scan results entries based on scan results from a scan
that was aborted. The aborted scan did not scan all the requested
channels or SSIDs, so the fact that a BSS is missing from the scan
results does not mean it is not available.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
---
 wpa_supplicant/bss.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jouni Malinen Oct. 14, 2015, 6:19 p.m. UTC | #1
On Wed, Oct 14, 2015 at 12:26:31PM +0300, Ilan Peer wrote:
> Do not expire scan results entries based on scan results from a scan
> that was aborted. The aborted scan did not scan all the requested
> channels or SSIDs, so the fact that a BSS is missing from the scan
> results does not mean it is not available.

I think I was kind of hoping the scanned frequency list to be accurate
for aborted scan, i.e., include only the channels that completed scan
before the operation was terminated. That would have already been
covered in wpa_bss_included_in_scan(), i.e., BSSes missing from the
results would not be expired if that frequency list were accurate..

Looking at the current cfg80211 implementation, it does not look like my
desired behavior is there, i.e., NL80211_ATTR_SCAN_FREQUENCIES is filled
based on the requested channels, not the channels that were actually
scanned. As such, I think I'll apply this to wpa_supplicant. Anyway, it
might be useful to consider a cfg80211 (and drivers, as may be the case)
contribution that would update the frequency list based on what actually
happened with the scan..
Peer, Ilan Oct. 15, 2015, 10:34 a.m. UTC | #2
> -----Original Message-----
> From: Jouni Malinen [mailto:j@w1.fi]
> Sent: Wednesday, October 14, 2015 21:19
> To: Peer, Ilan
> Cc: hostap@lists.shmoo.com; Stern, Avraham
> Subject: Re: [PATCH 2/4] wpa_supplicant: Do not expire scan results based on
> aborted scan
> 
> On Wed, Oct 14, 2015 at 12:26:31PM +0300, Ilan Peer wrote:
> > Do not expire scan results entries based on scan results from a scan
> > that was aborted. The aborted scan did not scan all the requested
> > channels or SSIDs, so the fact that a BSS is missing from the scan
> > results does not mean it is not available.
> 
> I think I was kind of hoping the scanned frequency list to be accurate for
> aborted scan, i.e., include only the channels that completed scan before the
> operation was terminated. That would have already been covered in
> wpa_bss_included_in_scan(), i.e., BSSes missing from the results would not be
> expired if that frequency list were accurate..
> 
> Looking at the current cfg80211 implementation, it does not look like my
> desired behavior is there, i.e., NL80211_ATTR_SCAN_FREQUENCIES is filled
> based on the requested channels, not the channels that were actually
> scanned. As such, I think I'll apply this to wpa_supplicant. Anyway, it might be
> useful to consider a cfg80211 (and drivers, as may be the case) contribution
> that would update the frequency list based on what actually happened with
> the scan..
> 

Not sure that this would be possible with all drivers/devices, so the flow would still need to support the
case the patch fixes. 

Regards,

Ilan.
diff mbox

Patch

diff --git a/wpa_supplicant/bss.c b/wpa_supplicant/bss.c
index 704ee7e..2003c66 100644
--- a/wpa_supplicant/bss.c
+++ b/wpa_supplicant/bss.c
@@ -799,7 +799,7 @@  void wpa_bss_update_end(struct wpa_supplicant *wpa_s, struct scan_info *info,
 	struct wpa_bss *bss, *n;
 
 	os_get_reltime(&wpa_s->last_scan);
-	if (!new_scan)
+	if ((info && info->aborted) || !new_scan)
 		return; /* do not expire entries without new scan */
 
 	dl_list_for_each_safe(bss, n, &wpa_s->bss, struct wpa_bss, list) {