]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Update link bandwidth when receiving channel switch event
authorChenming Huang <quic_chenhuan@quicinc.com>
Wed, 17 Apr 2024 03:32:27 +0000 (09:02 +0530)
committerJouni Malinen <j@w1.fi>
Mon, 22 Apr 2024 20:39:20 +0000 (23:39 +0300)
There is a chance that the driver has switched the channel width so we
should update the bandwidth, too, when receiving a channel switch event.
Otherwise, this may cause out of sync for bandwidth between i802_link
and hostapd_config.

Signed-off-by: Chenming Huang <quic_chenhuan@quicinc.com>
src/drivers/driver_nl80211_event.c

index 6e75748792bf2401407435cc9cfa6a98ed3b4e9b..e8ddb6337d0af8c6ecc5fce8ce79f6d26f51526f 100644 (file)
@@ -1272,8 +1272,14 @@ static void mlme_event_ch_switch(struct wpa_driver_nl80211_data *drv,
                        mld_link = nl80211_get_link(bss,
                                                    data.ch_switch.link_id);
                        mld_link->freq = data.ch_switch.freq;
+                       if (bw)
+                               mld_link->bandwidth = channel_width_to_int(
+                                       data.ch_switch.ch_width);
                } else {
                        bss->flink->freq = data.ch_switch.freq;
+                       if (bw)
+                               bss->flink->bandwidth = channel_width_to_int(
+                                       data.ch_switch.ch_width);
                }
        }