Skip to content

Commit e433304

Browse files
Miriam-Racheljmberg-intel
authored andcommitted
wifi: mac80211: Check if we had first beacon with relevant links
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. 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]>
1 parent 06d6af4 commit e433304

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
@@ -2936,9 +2936,20 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
29362936
* deauthentication frame by calling mgd_prepare_tx, if the
29372937
* driver requested so.
29382938
*/
2939-
if (ieee80211_hw_check(&local->hw, DEAUTH_NEED_MGD_TX_PREP) &&
2940-
!sdata->deflink.u.mgd.have_beacon) {
2941-
drv_mgd_prepare_tx(sdata->local, sdata, &info);
2939+
if (ieee80211_hw_check(&local->hw, DEAUTH_NEED_MGD_TX_PREP)) {
2940+
for (link_id = 0; link_id < ARRAY_SIZE(sdata->link);
2941+
link_id++) {
2942+
struct ieee80211_link_data *link;
2943+
2944+
link = sdata_dereference(sdata->link[link_id],
2945+
sdata);
2946+
if (!link)
2947+
continue;
2948+
if (link->u.mgd.have_beacon)
2949+
break;
2950+
}
2951+
if (link_id == IEEE80211_MLD_MAX_NUM_LINKS)
2952+
drv_mgd_prepare_tx(sdata->local, sdata, &info);
29422953
}
29432954

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

0 commit comments

Comments
 (0)