diff --git a/src/drivers/driver_nl80211_event.c b/src/drivers/driver_nl80211_event.c index 02c6eae49..51b27bd5e 100644 --- a/src/drivers/driver_nl80211_event.c +++ b/src/drivers/driver_nl80211_event.c @@ -1260,14 +1260,23 @@ static void mlme_event_ch_switch(struct wpa_driver_nl80211_data *drv, if (cf2) data.ch_switch.cf2 = nla_get_u32(cf2); - if (finished) - bss->flink->freq = data.ch_switch.freq; - if (link) data.ch_switch.link_id = nla_get_u8(link); else data.ch_switch.link_id = NL80211_DRV_LINK_ID_NA; + if (finished) { + if (data.ch_switch.link_id != NL80211_DRV_LINK_ID_NA) { + struct i802_link *mld_link; + + mld_link = nl80211_get_link(bss, + data.ch_switch.link_id); + mld_link->freq = data.ch_switch.freq; + } else { + bss->flink->freq = data.ch_switch.freq; + } + } + if (link && is_sta_interface(drv->nlmode)) { u8 link_id = data.ch_switch.link_id;