diff mbox series

do not perform CSA on disabled BSS.

Message ID 20240128170809.308101-1-gasmibal@gmail.com
State Superseded
Headers show
Series do not perform CSA on disabled BSS. | expand

Commit Message

Baligh Gasmi gasmibal@gmail.com Jan. 28, 2024, 5:08 p.m. UTC
It is useless to perform a channel switch, by announcing the new channel
information: CSA (Channel Switch Announcement), if the BSS is not running.

Signed-off-by: Baligh Gasmi <gasmibal@gmail.com>
---
 hostapd/ctrl_iface.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Jouni Malinen Jan. 29, 2024, 9:32 a.m. UTC | #1
On Sun, Jan 28, 2024 at 06:08:09PM +0100, Baligh Gasmi wrote:
> It is useless to perform a channel switch, by announcing the new channel
> information: CSA (Channel Switch Announcement), if the BSS is not running.

> diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
> @@ -2715,6 +2715,10 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface,
>  
>  	for (i = 0; i < iface->num_bss; i++) {
>  
> +		if(iface->bss[i]->disabled) {
> +			continue;
> +		}
> +
>  		/* Save CHAN_SWITCH VHT, HE, and EHT config */
>  		hostapd_chan_switch_config(iface->bss[i],
>  					   &settings.freq_params);

What would happen with the not yet started BSS in that case when it
might get enabled afterwards? Would it use the new channel from this
channel switch request? If not, this change might not be complete to
cover that case. It would seem most reasonable for all BSSs to be moved
to use the new channel and if there are disabled BSSs in this list, just
update their configuration immediately without going through CSA.
Baligh Gasmi gasmibal@gmail.com Jan. 29, 2024, 10:30 a.m. UTC | #2
Ok, right, and thanks for the reply.

In that case, let's make all the CSA stuffs (as already done), which
will update the BSS config.
And at the end, NL80211 will return 'Network Down' for the
channel_switch command, which can be ignored if the BSS is not
running.
(this is not a real bypass of CSA thought; it at least does not handle
'Network down' as an error)

patch v3 includes DISABLED/ENABLED events update in the nl802 driver,
to update status of all BSS and not only for the main one.
if you can take a look too.

Le lun. 29 janv. 2024 à 10:32, Jouni Malinen <j@w1.fi> a écrit :
>
> On Sun, Jan 28, 2024 at 06:08:09PM +0100, Baligh Gasmi wrote:
> > It is useless to perform a channel switch, by announcing the new channel
> > information: CSA (Channel Switch Announcement), if the BSS is not running.
>
> > diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
> > @@ -2715,6 +2715,10 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface,
> >
> >       for (i = 0; i < iface->num_bss; i++) {
> >
> > +             if(iface->bss[i]->disabled) {
> > +                     continue;
> > +             }
> > +
> >               /* Save CHAN_SWITCH VHT, HE, and EHT config */
> >               hostapd_chan_switch_config(iface->bss[i],
> >                                          &settings.freq_params);
>
> What would happen with the not yet started BSS in that case when it
> might get enabled afterwards? Would it use the new channel from this
> channel switch request? If not, this change might not be complete to
> cover that case. It would seem most reasonable for all BSSs to be moved
> to use the new channel and if there are disabled BSSs in this list, just
> update their configuration immediately without going through CSA.
>
> --
> Jouni Malinen                                            PGP id EFC895FA
diff mbox series

Patch

diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
index 2ba9856b4..7ccb3ca3b 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
@@ -2715,6 +2715,10 @@  static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface,
 
 	for (i = 0; i < iface->num_bss; i++) {
 
+		if(iface->bss[i]->disabled) {
+			continue;
+		}
+
 		/* Save CHAN_SWITCH VHT, HE, and EHT config */
 		hostapd_chan_switch_config(iface->bss[i],
 					   &settings.freq_params);