aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/events.c
diff options
context:
space:
mode:
authorArik Nemtsov <arik@wizery.com>2015-07-27 19:24:24 (GMT)
committerJouni Malinen <j@w1.fi>2015-08-04 13:04:52 (GMT)
commit0f4bccdbbe642fc620d2b70f60c8ddc4ad09a5db (patch)
tree2b96052741e8e8c3796e3228f7c1733d4793ee23 /wpa_supplicant/events.c
parentb1308121003480607dccb427cd2b8524021c5128 (diff)
downloadhostap-0f4bccdbbe642fc620d2b70f60c8ddc4ad09a5db.zip
hostap-0f4bccdbbe642fc620d2b70f60c8ddc4ad09a5db.tar.gz
hostap-0f4bccdbbe642fc620d2b70f60c8ddc4ad09a5db.tar.bz2
Refactor channel list update event in wpa_supplicant
Update hardware features for all interfaces inside the loop, don't treat the calling wpa_s instance specially. Perform the P2P channel list updates after the hardware features are updated. This will prevent P2P from relying on stale information. Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Diffstat (limited to 'wpa_supplicant/events.c')
-rw-r--r--wpa_supplicant/events.c24
1 files changed, 7 insertions, 17 deletions
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index 558e977..8b46810 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -2998,25 +2998,13 @@ static void wpa_supplicant_update_channel_list(
if (wpa_s->drv_priv == NULL)
return; /* Ignore event during drv initialization */
- free_hw_features(wpa_s);
- wpa_s->hw.modes = wpa_drv_get_hw_feature_data(
- wpa_s, &wpa_s->hw.num_modes, &wpa_s->hw.flags);
-
- wpas_p2p_update_channel_list(wpa_s);
-
- /*
- * Check other interfaces to see if they share the same radio. If
- * so, they get updated with this same hw mode info.
- */
dl_list_for_each(ifs, &wpa_s->radio->ifaces, struct wpa_supplicant,
radio_list) {
- if (ifs != wpa_s) {
- wpa_printf(MSG_DEBUG, "%s: Updating hw mode",
- ifs->ifname);
- free_hw_features(ifs);
- ifs->hw.modes = wpa_drv_get_hw_feature_data(
- ifs, &ifs->hw.num_modes, &ifs->hw.flags);
- }
+ wpa_printf(MSG_DEBUG, "%s: Updating hw mode",
+ ifs->ifname);
+ free_hw_features(ifs);
+ ifs->hw.modes = wpa_drv_get_hw_feature_data(
+ ifs, &ifs->hw.num_modes, &ifs->hw.flags);
}
/* Restart sched_scan with updated channel list */
@@ -3026,6 +3014,8 @@ static void wpa_supplicant_update_channel_list(
wpa_supplicant_cancel_sched_scan(wpa_s);
wpa_supplicant_req_scan(wpa_s, 0, 0);
}
+
+ wpas_p2p_update_channel_list(wpa_s);
}