Re: [PATCH v2] DFS: restart CAC in case of CAC is aborted

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Feb 19, 2018 at 06:49:30PM +0300, Dmitrii Lebed wrote:
> If CAC is aborted, hostapd will continue wait for
> CAC completion and will stuck in this state forever.
> Adding CAC restart action on CAC aborted event,
> considering "CAC aborted" state as recoverable.
> CAC aborted can be generated in some complex configs,
> e.g. in repeater config, when wpa_supplicant is
> doing something on another virtual interface that
> can lead to generation of "CAC aborted" event.

Please note that nl80211 drivers will indicate CAC aborted if a radar is
detected during the CAC. It does not sound correct to try to restart CAC
in such cases since the channel can clearly not be usable.

> diff --git a/src/ap/dfs.c b/src/ap/dfs.c
> @@ -636,6 +637,34 @@ static unsigned int dfs_get_cac_time(struct hostapd_iface *iface,
>         return cac_time_ms;
>  }
> 
> +static int dfs_start_cac(struct hostapd_iface *iface)
> +{
> +       int res;

This is whitespace damaged (tabs seemed to be converted to spaces) which
makes it quite inconvenient to try to apply this.

> @@ -800,9 +831,21 @@ int hostapd_dfs_complete_cac(struct hostapd_iface *iface, int success, int freq,

> +       } else {

So this is the !success case which is also entered if a radar is
detected during CAC.

> +               if (dfs_offload) {
> +                       if (iface->state == HAPD_IFACE_ENABLED)
> +                               iface->cac_started = 0;
> +               } else if (iface->state == HAPD_IFACE_DFS) {
> +                       /* Schedule CAC restart in 1 second */
> +                       eloop_register_timeout(1, 0, hostapd_dfs_cac_restart,
> +                                              iface, NULL);

That eloop timeout was not canceled anywhere. There needs to be some
protection against the interface being removed during the wait since
otherwise there would be a callback coming in with a pointer to freed
memory.

Where does this one second time come from? Why not immediately? Or
should the extra time be used to wait to see if NL80211_CMD_RADAR_DETECT
is received and if so, cancel this restarting attempt of CAC?

> -int hostapd_dfs_start_cac(struct hostapd_iface *iface, int freq,
> +int hostapd_dfs_cac_started(struct hostapd_iface *iface, int freq,

That renaming broke wpa_supplicant build. I'd leave this renaming to a
separate patch (also covering the needed wpa_supplicant/ap.c change) or
maybe just drop the renaming completely to avoid unnecessary changes.

-- 
Jouni Malinen                                            PGP id EFC895FA

_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux