From: Michal Kazior Date: Fri, 27 Jun 2014 12:19:29 +0000 (+0200) Subject: hostapd: Perform multi-BSS CSA for DFS properly X-Git-Tag: hostap_2_3~240 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8974620e3e114c4a812dac147b9730c55c47bf07;p=thirdparty%2Fhostap.git hostapd: Perform multi-BSS CSA for DFS properly Currently hostapd data structures aren't ready for multi-channel BSSes, so make DFS work now at least with single-channel multi-BSS channel switching. Signed-off-by: Michal Kazior --- diff --git a/src/ap/dfs.c b/src/ap/dfs.c index 9f42a776e..a11b2cf80 100644 --- a/src/ap/dfs.c +++ b/src/ap/dfs.c @@ -774,7 +774,7 @@ static int hostapd_dfs_start_channel_switch(struct hostapd_iface *iface) u8 vht_oper_centr_freq_seg1_idx; int skip_radar = 1; struct csa_settings csa_settings; - struct hostapd_data *hapd = iface->bss[0]; + unsigned int i; int err = 1; wpa_printf(MSG_DEBUG, "%s called (CAC active: %s, CSA active: %s)", @@ -853,7 +853,12 @@ static int hostapd_dfs_start_channel_switch(struct hostapd_iface *iface) return err; } - err = hostapd_switch_channel(hapd, &csa_settings); + for (i = 0; i < iface->num_bss; i++) { + err = hostapd_switch_channel(iface->bss[i], &csa_settings); + if (err) + break; + } + if (err) { wpa_printf(MSG_WARNING, "DFS failed to schedule CSA (%d) - trying fallback", err);