[PATCH] DFS: respect manual channel selection when channels are unaviable

Nicolas Escande nico.escande at gmail.com
Fri Mar 20 02:38:45 PDT 2026


On Thu Mar 19, 2026 at 6:10 PM CET, Jouni Malinen wrote:
> On Wed, Mar 04, 2026 at 03:52:00PM +0100, Nicolas Escande wrote:
>> When operating on a DFS channel, the code checks whether any of the spanned
>> subchannels are unavailable & selects a new operating channel if need be. This
>> is all good when using ACS as we do not care for the exact channel used in the
>> end but it shouldn't happen when the user explicitely provided a specific
>> channel number to use. We should respect it.
>
> I'm assuming the current behavior is actually by design to meet certain
> regulatory requirements related to having to select a random operating
> channel. As such, I'm not sure the proposed change should really be
> applied. Do you have more specific justification for proposing this
> modification to behavior?

Well it's hard to said because this logic seems to date back to the very
beginning of the DFS code so there is no single commit that add that logic
and explains it thoroughly.

So here is my thought process: this code in the loop enables an ap that is about
to start on a DFS channel (whether because of ACS or because of an explicit
channel config), to check for two things:

  - that all channels needed for that bandwidth are already cleared.
    --> In that case we skip the CAC and start the AP.
  - that all channels needed for that bandwidth are not unavailable (either
    disabled or in NOP because of a previous radar)
    --> In that case we get a new random channel that matches the bandwidth

So the second part, which is of interrest to me, doesn't seem to be about
spreading channel usage but more about ensuring operation even if it is not on
the previously selected channel.

And that seems completely fine when the user does not particullary care for the
selected channel but just wants a working AP: ie the ACS case.

But if I explicitely select a channel number (for example because I whant this
AP to end up on the same channel as another wifi node on my network, so they can
talk to each other via some other interface), I do not want my AP to magically
discard my channel config and switch to whatever channel it randomly chooses. I
would rather wait for the channels to become available (ie NOP to finish) so my
AP starts on the right channel.

Anyways that's where I'm at.



More information about the Hostap mailing list