Skip to content

Commit 96fa71a

Browse files
Miriam-Rachelzhoufuro
authored andcommitted
wifi: mac80211: Check if we had first beacon with relevant links
commit e433304 ("wifi: mac80211: Check if we had first beacon with relevant links") upstream. If there is a disassoc before the fisrt beacon we need to protect a session for the deauth frame. Currently we are checking if we had a beacon in the default link, which is wrong in a MLO connection and link id != 0. Fix this by checking all the active links, if none had a beacon then protect a session. If at least one link had a beacon there is no need for session protection. deepin-Intel-SIG: commit e433304 ("wifi: mac80211: Check if we had first beacon with relevant links"). Signed-off-by: Miri Korenblit <[email protected]> Signed-off-by: Gregory Greenman <[email protected]> Link: https://lore.kernel.org/r/20231004120820.d290f0ab77b0.Ic1505cf3d60f74580d31efa7e52046947c490b85@changeid Signed-off-by: Johannes Berg <[email protected]> [ Furong Zhou: amend commit log ] Signed-off-by: Furong Zhou <[email protected]>
1 parent 9d7d50f commit 96fa71a

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

net/mac80211/mlme.c

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2954,9 +2954,20 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
29542954
* deauthentication frame by calling mgd_prepare_tx, if the
29552955
* driver requested so.
29562956
*/
2957-
if (ieee80211_hw_check(&local->hw, DEAUTH_NEED_MGD_TX_PREP) &&
2958-
!sdata->deflink.u.mgd.have_beacon) {
2959-
drv_mgd_prepare_tx(sdata->local, sdata, &info);
2957+
if (ieee80211_hw_check(&local->hw, DEAUTH_NEED_MGD_TX_PREP)) {
2958+
for (link_id = 0; link_id < ARRAY_SIZE(sdata->link);
2959+
link_id++) {
2960+
struct ieee80211_link_data *link;
2961+
2962+
link = sdata_dereference(sdata->link[link_id],
2963+
sdata);
2964+
if (!link)
2965+
continue;
2966+
if (link->u.mgd.have_beacon)
2967+
break;
2968+
}
2969+
if (link_id == IEEE80211_MLD_MAX_NUM_LINKS)
2970+
drv_mgd_prepare_tx(sdata->local, sdata, &info);
29602971
}
29612972

29622973
ieee80211_send_deauth_disassoc(sdata, sdata->vif.cfg.ap_addr,

0 commit comments

Comments
 (0)