]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
STA OBSS: Update secondary channel info after CSA
authorSergey Matyukevich <geomatsi@gmail.com>
Fri, 27 Dec 2019 12:22:24 +0000 (15:22 +0300)
committerJouni Malinen <j@w1.fi>
Fri, 27 Dec 2019 19:04:57 +0000 (21:04 +0200)
Field wpa_s->sme.ht_sec_chan keeps secondary channel for the 40 MHz
band. This field is used to prepare a list of channels for the STA OBSS
scan. Initially, the secondary channel is set to HT_SEC_CHAN_UNKNOWN.
Later on, in function wpa_obss_scan_freq_list() it is obtained from the
current BSS HT operation IE. However, the secondary channel information
is not updated after channel switch, which may lead to an incorrect list
of channels prepared for the STA OBSS scan.

Update ht_sec_chan according to the channel switch event data to fix
this.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
wpa_supplicant/events.c

index f034e5040d7269d4e7b630b75cbf50de918caf8e..2bf35cb5898a16625b1f3f363ea05d85fd40f742 100644 (file)
@@ -4564,6 +4564,20 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
                wpa_s->assoc_freq = data->ch_switch.freq;
                wpa_s->current_ssid->frequency = data->ch_switch.freq;
 
+#ifdef CONFIG_SME
+               switch (data->ch_switch.ch_offset) {
+               case 1:
+                       wpa_s->sme.ht_sec_chan = HT_SEC_CHAN_ABOVE;
+                       break;
+               case -1:
+                       wpa_s->sme.ht_sec_chan = HT_SEC_CHAN_BELOW;
+                       break;
+               default:
+                       wpa_s->sme.ht_sec_chan = HT_SEC_CHAN_UNKNOWN;
+                       break;
+               }
+#endif /* CONFIG_SME */
+
 #ifdef CONFIG_AP
                if (wpa_s->current_ssid->mode == WPAS_MODE_AP ||
                    wpa_s->current_ssid->mode == WPAS_MODE_P2P_GO ||