aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/events.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2013-03-18 15:07:09 (GMT)
committerJouni Malinen <j@w1.fi>2013-03-18 15:32:31 (GMT)
commitcfd31b5026a403ae67f88c74b036207be05b3107 (patch)
tree99f0067469963426f6c93ad1f3f901342128ab96 /wpa_supplicant/events.c
parentb1cd021e2974bf79d764268f8645f28ffbb7f7f2 (diff)
downloadhostap-cfd31b5026a403ae67f88c74b036207be05b3107.zip
hostap-cfd31b5026a403ae67f88c74b036207be05b3107.tar.gz
hostap-cfd31b5026a403ae67f88c74b036207be05b3107.tar.bz2
Use special scan result processing steps only on requesting interface
Scan result events are shared between all virtual interfaces sharing the same radio. However, some of the steps are not really appropriate on virtual interfaces that did not issue the scan request. Fix this by making these steps conditional on the scan results being processed on the interface that requested them. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'wpa_supplicant/events.c')
-rw-r--r--wpa_supplicant/events.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index 1c48eba..d291990 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -1089,7 +1089,8 @@ 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
* be shared with other virtual interfaces. */
static int _wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s,
- union wpa_event_data *data)
+ union wpa_event_data *data,
+ int own_request)
{
struct wpa_scan_results *scan_res;
int ap = 0;
@@ -1105,7 +1106,7 @@ static int _wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s,
wpa_supplicant_notify_scanning(wpa_s, 0);
#ifdef CONFIG_P2P
- if (wpa_s->global->p2p_cb_on_scan_complete &&
+ if (own_request && wpa_s->global->p2p_cb_on_scan_complete &&
!wpa_s->global->p2p_disabled &&
wpa_s->global->p2p != NULL && !wpa_s->sta_scan_pending &&
!wpa_s->scan_res_handler) {
@@ -1128,6 +1129,8 @@ static int _wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s,
if (wpa_s->conf->ap_scan == 2 || ap ||
wpa_s->scan_res_handler == scan_only_handler)
return -1;
+ if (!own_request)
+ return -1;
wpa_dbg(wpa_s, MSG_DEBUG, "Failed to get scan results - try "
"scanning again");
wpa_supplicant_req_new_scan(wpa_s, 1, 0);
@@ -1150,7 +1153,7 @@ static int _wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s,
}
#endif /* CONFIG_NO_RANDOM_POOL */
- if (wpa_s->scan_res_handler) {
+ if (own_request && wpa_s->scan_res_handler) {
void (*scan_res_handler)(struct wpa_supplicant *wpa_s,
struct wpa_scan_results *scan_res);
@@ -1292,7 +1295,7 @@ static void wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s,
const char *rn, *rn2;
struct wpa_supplicant *ifs;
- if (_wpa_supplicant_event_scan_results(wpa_s, data) != 0) {
+ if (_wpa_supplicant_event_scan_results(wpa_s, data, 1) != 0) {
/*
* If no scan results could be fetched, then no need to
* notify those interfaces that did not actually request
@@ -1325,7 +1328,7 @@ static void wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s,
if (rn2 && os_strcmp(rn, rn2) == 0) {
wpa_printf(MSG_DEBUG, "%s: Updating scan results from "
"sibling", ifs->ifname);
- _wpa_supplicant_event_scan_results(ifs, data);
+ _wpa_supplicant_event_scan_results(ifs, data, 0);
}
}
}