aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2012-09-14 13:03:12 -0700
committerDmitry Shmidt <dimitrysh@google.com>2012-09-14 13:03:12 -0700
commit89ca702e8ed3247d7007dbdebe531036671c34af (patch)
tree6871ab5f9e468a37e0a685455abf46a48b09d73a
parentfa08f9eb31989e0973eb8ed0bd14c238be19ab0b (diff)
downloadexternal_wpa_supplicant_8-89ca702e8ed3247d7007dbdebe531036671c34af.zip
external_wpa_supplicant_8-89ca702e8ed3247d7007dbdebe531036671c34af.tar.gz
external_wpa_supplicant_8-89ca702e8ed3247d7007dbdebe531036671c34af.tar.bz2
Do not inform other virtual interfaces of scan results in all cases
If a connection operation is started on an interface based on scan results, other virtual interfaces should not be information about the results to avoid potential concurrent operations during the association steps. Since the sibling notification of scan results received was added as an optimization, skipping it for this type of cases is the simplest way of avoiding unnecessary concurrent operations. Change-Id: I145b4237074a97cc75fd68933fff7ed99b850630 Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
-rw-r--r--wpa_supplicant/events.c17
-rw-r--r--wpa_supplicant/interworking.c2
2 files changed, 13 insertions, 6 deletions
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index b030a73..fdcbcc2 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -1033,7 +1033,7 @@ static int wpa_supplicant_need_to_roam(struct wpa_supplicant *wpa_s,
}
-/* Return < 0 if no scan results could be fetched or if scan results should not
+/* Return != 0 if no scan results could be fetched or if scan results should not
* be shared with other virtual interfaces. */
#ifdef ANDROID_P2P
static int _wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s,
@@ -1191,6 +1191,11 @@ int wpas_select_network_from_last_scan(struct wpa_supplicant *wpa_s)
return -1;
}
wpa_supplicant_rsn_preauth_scan_results(wpa_s);
+ /*
+ * Do not notify other virtual radios of scan results since we do not
+ * want them to start other associations at the same time.
+ */
+ return 1;
} else {
wpa_dbg(wpa_s, MSG_DEBUG, "No suitable network found");
ssid = wpa_supplicant_pick_new_network(wpa_s);
@@ -1227,7 +1232,7 @@ int wpas_select_network_from_last_scan(struct wpa_supplicant *wpa_s)
wpa_s->network_select = 1;
wpa_s->auto_network_select = 1;
interworking_start_fetch_anqp(wpa_s);
- return 0;
+ return 1;
}
#endif /* CONFIG_INTERWORKING */
if (wpa_supplicant_req_sched_scan(wpa_s))
@@ -1245,14 +1250,16 @@ static void wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s,
const char *rn, *rn2;
struct wpa_supplicant *ifs;
#ifdef ANDROID_P2P
- if (_wpa_supplicant_event_scan_results(wpa_s, data, 0) < 0) {
+ if (_wpa_supplicant_event_scan_results(wpa_s, data, 0) != 0) {
#else
- if (_wpa_supplicant_event_scan_results(wpa_s, data) < 0) {
+ if (_wpa_supplicant_event_scan_results(wpa_s, data) != 0) {
#endif
/*
* If no scan results could be fetched, then no need to
* notify those interfaces that did not actually request
- * this scan.
+ * this scan. Similarly, if scan results started a new operation on this
+ * interface, do not notify other interfaces to avoid concurrent
+ * operations during a connection attempt.
*/
return;
}
diff --git a/wpa_supplicant/interworking.c b/wpa_supplicant/interworking.c
index b362bcb..22f709f 100644
--- a/wpa_supplicant/interworking.c
+++ b/wpa_supplicant/interworking.c
@@ -59,7 +59,7 @@ static void interworking_reconnect(struct wpa_supplicant *wpa_s)
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)
+ if (wpas_select_network_from_last_scan(wpa_s) >= 0)
return;
}
}