[PATCH] ACS: to improve the checking of available ACS channel list

Jouni Malinen j at w1.fi
Sat Sep 21 05:47:14 PDT 2019


On Wed, Sep 18, 2019 at 03:39:50PM +0800, neojou at gmail.com wrote:
> When we set "channel=0" in hostapd.conf to enable ACS function,
> and set the wrong channel list, e.g. chanlist=222-999 on purpose,
> hostapd will still start ACS process to compute ideal channel,
> even there is no available channel in this setting.
> 
> Though there is no problem since hostapd fails to initialize
> interface, it spends time and may cause some problem to tell if
> the setting is correct at the first.
> 
> Thus would like to suggest the following patch, we can check if
> there is any available channels in the function acs_request_scan()
> at the first, and return -1 if no available channel, then it will
> fail at acs_init(), without doing ACS computation. It will show
> the following in the log:
>     Could not select hw_mode and channel. (-3)
>     wlan0: interface state UNINITIALIZED->DISABLED
> 
> Then we can know the setting is incorrect at the first at
> hostapd_select_hw_mode(), instead of waiting for scan callback
> function to know if the setting is ok for ACS or not. It can save
> time and help to tell if the setting is correct at the initial
> function at the first.

Thanks, applied.
 
-- 
Jouni Malinen                                            PGP id EFC895FA



More information about the Hostap mailing list