Skip to content

Commit e05eccc

Browse files
minshalljjmberg-intel
authored andcommitted
mac80211: set mesh formation field properly
Cap max peerings at 63 in accordance with IEEE-2012 8.4.2.100.7. Triggers a beacon regeneration every time the number of peerings changes. Previously this would only happen if the "accepting peerings" bit changed. Signed-off-by: Jacob Minshall <jacob@cozybit.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent 866403a commit e05eccc

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎include/linux/ieee80211.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ static inline u16 ieee80211_sn_sub(u16 sn1, u16 sn2)
146146
#define IEEE80211_MAX_RTS_THRESHOLD 2353
147147
#define IEEE80211_MAX_AID 2007
148148
#define IEEE80211_MAX_TIM_LEN 251
149+
#define IEEE80211_MAX_MESH_PEERINGS 63
149150
/* Maximum size for the MA-UNITDATA primitive, 802.11 standard section
150151
6.2.1.1.2.
151152

‎net/mac80211/mesh.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,7 @@ int mesh_add_meshconf_ie(struct ieee80211_sub_if_data *sdata,
274274
*pos++ = ifmsh->mesh_auth_id;
275275
/* Mesh Formation Info - number of neighbors */
276276
neighbors = atomic_read(&ifmsh->estab_plinks);
277-
/* Number of neighbor mesh STAs or 15 whichever is smaller */
278-
neighbors = (neighbors > 15) ? 15 : neighbors;
277+
neighbors = min_t(int, neighbors, IEEE80211_MAX_MESH_PEERINGS);
279278
*pos++ = neighbors << 1;
280279
/* Mesh capability */
281280
*pos = IEEE80211_MESHCONF_CAPAB_FORWARDING;

‎net/mac80211/mesh.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,14 +324,14 @@ static inline
324324
u32 mesh_plink_inc_estab_count(struct ieee80211_sub_if_data *sdata)
325325
{
326326
atomic_inc(&sdata->u.mesh.estab_plinks);
327-
return mesh_accept_plinks_update(sdata);
327+
return mesh_accept_plinks_update(sdata) | BSS_CHANGED_BEACON;
328328
}
329329

330330
static inline
331331
u32 mesh_plink_dec_estab_count(struct ieee80211_sub_if_data *sdata)
332332
{
333333
atomic_dec(&sdata->u.mesh.estab_plinks);
334-
return mesh_accept_plinks_update(sdata);
334+
return mesh_accept_plinks_update(sdata) | BSS_CHANGED_BEACON;
335335
}
336336

337337
static inline int mesh_plink_free_count(struct ieee80211_sub_if_data *sdata)

0 commit comments

Comments
 (0)