aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/events.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2015-08-21 15:28:28 (GMT)
committerJouni Malinen <j@w1.fi>2015-08-21 21:22:12 (GMT)
commitdfaf11d648fb131237dfe1df80d8537d5cce92fb (patch)
tree49d62c49744403fc05b21d218be253a439ac493b /wpa_supplicant/events.c
parent8493fe34579415da546cde637c95da1cb979eb03 (diff)
downloadhostap-dfaf11d648fb131237dfe1df80d8537d5cce92fb.zip
hostap-dfaf11d648fb131237dfe1df80d8537d5cce92fb.tar.gz
hostap-dfaf11d648fb131237dfe1df80d8537d5cce92fb.tar.bz2
P2P: Require fresh scan results for persistent group re-invocation
The P2P group is not yet operating when going through invitation exchange for re-invocation. Previously, an old cached scan result could be used to skip the scan immediately after the invitation exchange. While this may result in the fastest possible connection, it does have some issues with cases where the GO takes some time to start up. It would also be at least theoretically possible for some of the BSS parameters to be different, so having a fresh scan result from the new GO instance may be desired in any case. Add a mechanism to skip scan results that have been last updated before a specific point in time and as the first user for this mechanism, require chan results to be more recent than the invitation message exchange for the P2P Client role in persistent group re-invocation case. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'wpa_supplicant/events.c')
-rw-r--r--wpa_supplicant/events.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index d95e066..4f082d2 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -1036,6 +1036,19 @@ static struct wpa_ssid * wpa_scan_res_match(struct wpa_supplicant *wpa_s,
*/
#endif /* CONFIG_P2P */
+ if (os_reltime_before(&bss->last_update, &wpa_s->scan_min_time))
+ {
+ struct os_reltime diff;
+
+ os_reltime_sub(&wpa_s->scan_min_time,
+ &bss->last_update, &diff);
+ wpa_dbg(wpa_s, MSG_DEBUG,
+ " skip - scan result not recent enough (%u.%06u seconds too old)",
+ (unsigned int) diff.sec,
+ (unsigned int) diff.usec);
+ continue;
+ }
+
/* Matching configuration found */
return ssid;
}