Skip to content

Commit 45c2e21

Browse files
Tamizh chelvamgregkh
authored andcommitted
mac80211: fix channel switch trigger from unknown mesh peer
[ Upstream commit 93e2d04 ] Previously mesh channel switch happens if beacon contains CSA IE without checking the mesh peer info. Due to that channel switch happens even if the beacon is not from its own mesh peer. Fixing that by checking if the CSA originated from the same mesh network before proceeding for channel switch. Signed-off-by: Tamizh chelvam <tamizhr@codeaurora.org> Link: https://lore.kernel.org/r/1585403604-29274-1-git-send-email-tamizhr@codeaurora.org Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 9d9b300 commit 45c2e21

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

‎net/mac80211/mesh.c‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1257,15 +1257,15 @@ static void ieee80211_mesh_rx_bcn_presp(struct ieee80211_sub_if_data *sdata,
12571257
sdata->u.mesh.mshcfg.rssi_threshold < rx_status->signal)
12581258
mesh_neighbour_update(sdata, mgmt->sa, &elems,
12591259
rx_status);
1260+
1261+
if (ifmsh->csa_role != IEEE80211_MESH_CSA_ROLE_INIT &&
1262+
!sdata->vif.csa_active)
1263+
ieee80211_mesh_process_chnswitch(sdata, &elems, true);
12601264
}
12611265

12621266
if (ifmsh->sync_ops)
12631267
ifmsh->sync_ops->rx_bcn_presp(sdata,
12641268
stype, mgmt, &elems, rx_status);
1265-
1266-
if (ifmsh->csa_role != IEEE80211_MESH_CSA_ROLE_INIT &&
1267-
!sdata->vif.csa_active)
1268-
ieee80211_mesh_process_chnswitch(sdata, &elems, true);
12691269
}
12701270

12711271
int ieee80211_mesh_finish_csa(struct ieee80211_sub_if_data *sdata)
@@ -1373,6 +1373,9 @@ static void mesh_rx_csa_frame(struct ieee80211_sub_if_data *sdata,
13731373
ieee802_11_parse_elems(pos, len - baselen, true, &elems,
13741374
mgmt->bssid, NULL);
13751375

1376+
if (!mesh_matches_local(sdata, &elems))
1377+
return;
1378+
13761379
ifmsh->chsw_ttl = elems.mesh_chansw_params_ie->mesh_ttl;
13771380
if (!--ifmsh->chsw_ttl)
13781381
fwd_csa = false;

0 commit comments

Comments
 (0)