diff mbox

[1/2] hostapd: DFS/CSA check if CSA in progress

Message ID 1389176868-6610-1-git-send-email-janusz.dziedzic@tieto.com
State Accepted
Headers show

Commit Message

Janusz.Dziedzic@tieto.com Jan. 8, 2014, 10:27 a.m. UTC
Check if CSA is already in progress, before
trigger new channel switch.

Signed-hostap: Janusz Dziedzic <janusz.dziedzic@tieto.com>
---
 src/ap/dfs.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

Comments

Jouni Malinen Jan. 14, 2014, 4:11 p.m. UTC | #1
On Wed, Jan 08, 2014 at 11:27:47AM +0100, Janusz Dziedzic wrote:
> Check if CSA is already in progress, before
> trigger new channel switch.

Thanks, applied with the v2 of 2/2.
diff mbox

Patch

diff --git a/src/ap/dfs.c b/src/ap/dfs.c
index caf4092..7ee829a 100644
--- a/src/ap/dfs.c
+++ b/src/ap/dfs.c
@@ -680,14 +680,17 @@  static int hostapd_dfs_start_channel_switch(struct hostapd_iface *iface)
 	struct hostapd_data *hapd = iface->bss[0];
 	int err = 1;
 
-	wpa_printf(MSG_DEBUG, "%s called (CAC active: %s)", __func__,
-		   iface->cac_started ? "yes" : "no");
+	wpa_printf(MSG_DEBUG, "%s called (CAC active: %s, CSA active: %s)", __func__,
+		   iface->cac_started ? "yes" : "no", iface->csa_in_progress ? "yes" : "no");
+
+	/* Check if CSA in progress */
+	if (iface->csa_in_progress)
+		return 0;
 
 	/* Check if active CAC */
 	if (iface->cac_started)
 		return hostapd_dfs_start_channel_switch_cac(iface);
 
-
 	/* Perform channel switch/CSA */
 	channel = dfs_get_valid_channel(iface, &secondary_channel,
 					&vht_oper_centr_freq_seg0_idx,