mac80211: mesh STAs only process mesh beacons
PATCH 1/1 mac80211: mesh STAs only process mesh beacons
Before, a mesh STA would execute some code on behalf of AP or IBSS beacons. Since the mesh stack currently does not consider anything but other mesh STAs interesting, limit processing to just these and save a little overhead.
--- net/mac80211/mesh.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
net/mac80211/mesh.c +7 -4
@@ -681,8 +681,12 @@ static void ieee80211_mesh_rx_bcn_presp(struct ieee80211_sub_if_data *sdata,ieee802_11_parse_elems (mgmt->u.probe_resp.variable, len - baselen, &elems); -/* ignore beacons from secure mesh peers if our security is off */ -if (elems.rsn_len && sdata->u.mesh.security ==IEEE80211_MESH_SEC_NONE ) +/* ignore non-mesh or secure / unsecure mismatch */ +if ((!elems.mesh_id || !elems.mesh_config) || + (elems.rsn && + sdata->u.mesh.security ==IEEE80211_MESH_SEC_NONE ) || + (!elems.rsn && + sdata->u.mesh.security !=IEEE80211_MESH_SEC_NONE ))return ;if (elems.ds_params && elems.ds_params_len ==1 )
@@ -695,8 +699,7 @@ static void ieee80211_mesh_rx_bcn_presp(struct ieee80211_sub_if_data *sdata,if (!channel || channel->flags &IEEE80211_CHAN_DISABLED )return ; -if (elems.mesh_id && elems.mesh_config && -mesh_matches_local (sdata, &elems)) +if (mesh_matches_local (sdata, &elems))mesh_neighbour_update (sdata, mgmt->sa, &elems);if (ifmsh->sync_ops)
Signature · 1 line
1.7.9.5
Johannes Berg
maintainerQuoted 4 lines · Thomas Pedersen
Before, a mesh STA would execute some code on behalf of AP or IBSS beacons. Since the mesh stack currently does not consider anything but other mesh STAs interesting, limit processing to just these and save a little overhead.
I can apply this, but I think while you're at it the function deserves a bit more thought:
net/mac80211/mesh.c static void ieee80211_mesh_rx_bcn_presp(struct ieee80211_sub_if_data *sdata, · line 705
Quoted 8 lines
Signed-off-by Thomas Pedersen <[email protected]>net/mac80211/mesh.c +1
-2-if (elems.mesh_id && elems.mesh_config && -mesh_matches_local (sdata, &elems)) +if (mesh_matches_local (sdata, &elems))mesh_neighbour_update (sdata, mgmt->sa, &elems);if (ifmsh->sync_ops)
Why would you want to invoke sync_ops when the mesh is somebody else's mesh, i.e. doesn't match local?
johannes
Quoted 16 lines · Johannes Berg
Quoted 4 lines · Thomas Pedersen
Before, a mesh STA would execute some code on behalf of AP or IBSS beacons. Since the mesh stack currently does not consider anything but other mesh STAs interesting, limit processing to just these and save a little overhead.
I can apply this, but I think while you're at it the function deserves a bit more thought:
Quoted 7 lines
Signed-off-by Thomas Pedersen <[email protected]>net/mac80211/mesh.c +1
-2-if (elems.mesh_id && elems.mesh_config && -mesh_matches_local (sdata, &elems)) +if (mesh_matches_local (sdata, &elems))mesh_neighbour_update (sdata, mgmt->sa, &elems);
Quoted 4 lines
Quoted 1 line
if (ifmsh->sync_ops)Why would you want to invoke
sync_opswhen the mesh is somebody else's mesh, i.e. doesn't match local?
Right now we only allocate a sta_info if mesh_matches_local, so sync_ops should simply fail its sta_info lookup and return.
In the future we might want to allocate station entries for non-peers as well since it is useful to track the Toffset of non-peer neighbors for beacon collision avoidance and scheduling MCCAOP interference periods. This is also required by the standard FWIW.
Thomas
Johannes Berg
maintainerQuoted 23 lines · Thomas Pedersen
Quoted 16 lines · Johannes Berg
Quoted 4 lines · Thomas Pedersen
Before, a mesh STA would execute some code on behalf of AP or IBSS beacons. Since the mesh stack currently does not consider anything but other mesh STAs interesting, limit processing to just these and save a little overhead.
I can apply this, but I think while you're at it the function deserves a bit more thought:
Quoted 7 lines
Signed-off-by Thomas Pedersen <[email protected]>net/mac80211/mesh.c +1
-2-if (elems.mesh_id && elems.mesh_config && -mesh_matches_local (sdata, &elems)) +if (mesh_matches_local (sdata, &elems))mesh_neighbour_update (sdata, mgmt->sa, &elems);Quoted 4 lines
Quoted 1 line
if (ifmsh->sync_ops)Why would you want to invoke
sync_opswhen the mesh is somebody else's mesh, i.e. doesn't match local?
Quoted 7 lines
Right now we only allocate a
sta_infoifmesh_matches_local, sosync_opsshould simply fail itssta_infolookup and return.In the future we might want to allocate station entries for non-peers as well since it is useful to track the Toffset of non-peer neighbors for beacon collision avoidance and scheduling MCCAOP interference periods. This is also required by the standard FWIW.
Ok, fair enough. FWIW, Antonio is also working on tracking non-peer stations (not as station entries, but separately) so maybe you should collaborate.
Applied your patch.
johannes