wifi: mac80211: remove TDLS peers only on affected link
If a link does CSA, or if it changes SMPS mode, we need to drop the TDLS peers, but we really should drop them only on the affected link. Fix that. Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com> Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Link: https://msgid.link/20240228095719.00d1d793f5b8.Ia9971316c6b3922dd371d64ac2198f91ed5ad9d2@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
parent
f3dee30c67
commit
85977fc0aa
@ -3242,7 +3242,7 @@ int __ieee80211_request_smps_mgd(struct ieee80211_sub_if_data *sdata,
|
||||
if (err)
|
||||
link->u.mgd.req_smps = old_req;
|
||||
else if (smps_mode != IEEE80211_SMPS_OFF && tdls_peer_found)
|
||||
ieee80211_teardown_tdls_peers(sdata);
|
||||
ieee80211_teardown_tdls_peers(link);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
@ -2611,7 +2611,7 @@ int ieee80211_tdls_channel_switch(struct wiphy *wiphy, struct net_device *dev,
|
||||
void ieee80211_tdls_cancel_channel_switch(struct wiphy *wiphy,
|
||||
struct net_device *dev,
|
||||
const u8 *addr);
|
||||
void ieee80211_teardown_tdls_peers(struct ieee80211_sub_if_data *sdata);
|
||||
void ieee80211_teardown_tdls_peers(struct ieee80211_link_data *link);
|
||||
void ieee80211_tdls_handle_disconnect(struct ieee80211_sub_if_data *sdata,
|
||||
const u8 *peer, u16 reason);
|
||||
void
|
||||
|
@ -2115,12 +2115,13 @@ ieee80211_sta_process_chanswitch(struct ieee80211_link_data *link,
|
||||
}
|
||||
|
||||
/*
|
||||
* Drop all TDLS peers - either we disconnect or move to a different
|
||||
* channel from this point on. There's no telling what our peer will do.
|
||||
* Drop all TDLS peers on the affected link - either we disconnect or
|
||||
* move to a different channel from this point on. There's no telling
|
||||
* what our peer will do.
|
||||
* The TDLS WIDER_BW scenario is also problematic, as peers might now
|
||||
* have an incompatible wider chandef.
|
||||
*/
|
||||
ieee80211_teardown_tdls_peers(sdata);
|
||||
ieee80211_teardown_tdls_peers(link);
|
||||
|
||||
conf = rcu_dereference_protected(link->conf->chanctx_conf,
|
||||
lockdep_is_held(&local->hw.wiphy->mtx));
|
||||
|
@ -2028,8 +2028,9 @@ ieee80211_process_tdls_channel_switch(struct ieee80211_sub_if_data *sdata,
|
||||
}
|
||||
}
|
||||
|
||||
void ieee80211_teardown_tdls_peers(struct ieee80211_sub_if_data *sdata)
|
||||
void ieee80211_teardown_tdls_peers(struct ieee80211_link_data *link)
|
||||
{
|
||||
struct ieee80211_sub_if_data *sdata = link->sdata;
|
||||
struct sta_info *sta;
|
||||
u16 reason = WLAN_REASON_TDLS_TEARDOWN_UNSPECIFIED;
|
||||
|
||||
@ -2039,6 +2040,9 @@ void ieee80211_teardown_tdls_peers(struct ieee80211_sub_if_data *sdata)
|
||||
!test_sta_flag(sta, WLAN_STA_AUTHORIZED))
|
||||
continue;
|
||||
|
||||
if (sta->deflink.link_id != link->link_id)
|
||||
continue;
|
||||
|
||||
ieee80211_tdls_oper_request(&sdata->vif, sta->sta.addr,
|
||||
NL80211_TDLS_TEARDOWN, reason,
|
||||
GFP_ATOMIC);
|
||||
|
Loading…
Reference in New Issue
Block a user