Skip to content

Commit 0b2d9d9

Browse files
committed
wifi: mac80211: correcty limit wider BW TDLS STAs
When updating a channel context, the code can apply wider bandwidth TDLS STA channel definitions to each and every channel context used by the device, an approach that will surely lead to problems if there is ever more than one. Restrict the wider BW TDLS STA consideration to only TDLS STAs that are actually related to links using the channel context being updated. Fixes: 0fabfaa ("mac80211: upgrade BW of TDLS peers when possible") Reviewed-by: Miriam Rachel Korenblit <[email protected]> Link: https://patch.msgid.link/20240612143707.1ad989acecde.I5c75c94d95c3f4ea84f8ff4253189f4b13bad5c3@changeid Signed-off-by: Johannes Berg <[email protected]>
1 parent d42fcae commit 0b2d9d9

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

net/mac80211/chan.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -793,13 +793,24 @@ void ieee80211_recalc_chanctx_chantype(struct ieee80211_local *local,
793793

794794
/* TDLS peers can sometimes affect the chandef width */
795795
list_for_each_entry(sta, &local->sta_list, list) {
796+
struct ieee80211_sub_if_data *sdata = sta->sdata;
796797
struct ieee80211_chan_req tdls_chanreq = {};
798+
int tdls_link_id;
799+
797800
if (!sta->uploaded ||
798801
!test_sta_flag(sta, WLAN_STA_TDLS_WIDER_BW) ||
799802
!test_sta_flag(sta, WLAN_STA_AUTHORIZED) ||
800803
!sta->tdls_chandef.chan)
801804
continue;
802805

806+
tdls_link_id = ieee80211_tdls_sta_link_id(sta);
807+
link = sdata_dereference(sdata->link[tdls_link_id], sdata);
808+
if (!link)
809+
continue;
810+
811+
if (rcu_access_pointer(link->conf->chanctx_conf) != conf)
812+
continue;
813+
803814
tdls_chanreq.oper = sta->tdls_chandef;
804815

805816
/* note this always fills and returns &tmp if compat */

0 commit comments

Comments
 (0)