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

Jouni Malinen j
Fri Feb 14 09:02:50 PST 2014


On Wed, Feb 05, 2014 at 06:10:10PM +0100, Simon Wunderlich wrote:
> 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.

Shutting down an interface sounds reasonable. Terminating the process
does not, e.g., if there are multiple radios controlled by a single
hostapd process.

> @@ -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();

Calling eloop_terminate() is almost never an acceptable solution if
there is possibility that other radios are being controlled or if the
interface was added through a control interface operation (that control
interface would disappear when hostapd process exists without leaving
any chance for the external control program to add back the interface).

-- 
Jouni Malinen                                            PGP id EFC895FA



More information about the Hostap mailing list