2012-04-23 16:35:44

by Wey-Yi Guy

[permalink] [raw]
Subject: [PATCH v2 1/1] mac80211: check for non-managed interface

Average beacon signal only keep tracked by managed interface,
give warning and return 0 for the others.

Signed-off-by: Wey-Yi Guy <[email protected]>
---
net/mac80211/util.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 89c1e5b..d0c979e 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -1799,5 +1799,9 @@ int ieee80211_ave_rssi(struct ieee80211_vif *vif)
struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif);
struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;

+ if (WARN_ON_ONCE(sdata->vif.type != NL80211_IFTYPE_STATION)) {
+ /* non-managed type inferfaces */
+ return 0;
+ }
return ifmgd->ave_beacon_signal;
}
--
1.7.0.4