[PATCHv2,4/4] hostapd: terminate hostapd when no channel is available

Submitted by Simon Wunderlich on Feb. 6, 2014, 6:30 p.m.

Details

Message ID 1391711440-10607-5-git-send-email-sw@simonwunderlich.de
State Deferred
Headers show

Commit Message

Simon Wunderlich Feb. 6, 2014, 6:30 p.m.
Until hostapd is able to restart service on a channel (e.g. by reacting
to an event that a DFS non-occupancy period is over), better shut down
hostapd when no channel is available anymore.

The current behaviour, disabling the interface, will just lead to
hostapd hanging without recovering frmo this state. If hostapd shuts
down, userspace can at least work around and restart hostapd when
channels are available again.

Signed-hostap: Simon Wunderlich <sw@simonwunderlich.de>
---
 src/ap/dfs.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/ap/dfs.c b/src/ap/dfs.c
index 78668dc..a46811a 100644
--- a/src/ap/dfs.c
+++ b/src/ap/dfs.c
@@ -10,6 +10,7 @@ 
 #include "utils/includes.h"
 
 #include "utils/common.h"
+#include "utils/eloop.h"
 #include "common/ieee802_11_defs.h"
 #include "common/wpa_ctrl.h"
 #include "hostapd.h"
@@ -734,7 +735,7 @@  static int hostapd_dfs_start_channel_switch(struct hostapd_iface *iface)
 						skip_radar);
 		if (!channel) {
 			/* FIXME: Wait for channel(s) to become available */
-			hostapd_disable_iface(iface);
+			eloop_terminate();
 			return err;
 
 		}
@@ -776,7 +777,7 @@  static int hostapd_dfs_start_channel_switch(struct hostapd_iface *iface)
 
 	if (err) {
 		wpa_printf(MSG_ERROR, "DFS failed to calculate CSA freq params");
-		hostapd_disable_iface(iface);
+		eloop_terminate();
 		return err;
 	}