summaryrefslogtreecommitdiffstats
path: root/net/mac80211/sta_info.c
diff options
context:
space:
mode:
authorThomas Pedersen <thomas@cozybit.com>2013-11-05 11:17:05 -0800
committerJohannes Berg <johannes.berg@intel.com>2013-11-25 20:50:29 +0100
commit204d130426206071b08c0aa74002fbdb67960eed (patch)
treec1f4a7788bba2b3afe9c5df2254995231daefc9c /net/mac80211/sta_info.c
parentc99a89edb1066e4c1f79b3ca4e91a676d1b25ce1 (diff)
downloadlinux-204d130426206071b08c0aa74002fbdb67960eed.tar.bz2
mac80211: clean up mesh local link ID generation
802.11-2012 13.3.1 implicitly limits the mesh local link ID range to that of AID, since for mesh PS the local link ID must be indicated in the TIM IE, which only holds IEEE80211_MAX_AID bits. Also the code was allowing a local link ID of 0, but this is not correct since that TIM bit is used for indicating buffered mcast frames. Generate a random, unique, link ID from 1 - 2007, and drop a modulo conversion for the local link ID, but keep it for the peer link ID in case he chose something > MAX_AID. Signed-off-by: Thomas Pedersen <thomas@cozybit.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/sta_info.c')
-rw-r--r--net/mac80211/sta_info.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index 1eb66e26e49d..7a9151590cce 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -630,8 +630,8 @@ void sta_info_recalc_tim(struct sta_info *sta)
#ifdef CONFIG_MAC80211_MESH
} else if (ieee80211_vif_is_mesh(&sta->sdata->vif)) {
ps = &sta->sdata->u.mesh.ps;
- /* TIM map only for PLID <= IEEE80211_MAX_AID */
- id = le16_to_cpu(sta->plid) % IEEE80211_MAX_AID;
+ /* TIM map only for 1 <= PLID <= IEEE80211_MAX_AID */
+ id = le16_to_cpu(sta->plid) % (IEEE80211_MAX_AID + 1);
#endif
} else {
return;