aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChun-Yeow Yeoh <yeohchunyeow@gmail.com>2014-01-22 01:53:04 -0500
committerJohannes Berg <johannes.berg@intel.com>2014-02-04 15:48:15 -0500
commitc782bf8caae59a6cdd17ed1b99c126167dae49b2 (patch)
tree6d47061280c5f2602b27a5483a49c8cfedcb7f8e
parent772f0389338cfcf96da1c178046dc7e1649ab554 (diff)
mac80211: fix the increment of mesh precedence value
The mesh precedence value in ieee80211_channel_switch should be incremented or set to 1 only if this is the initiator of mesh channel switch. For non-initiator, the precedence value has updated using the Mesh Channel Switch Parameters element. Fix this. Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r--net/mac80211/cfg.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 032081c4cc65..e948b382cd45 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -3207,13 +3207,13 @@ int ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev,
3207 params->chandef.chan->band) 3207 params->chandef.chan->band)
3208 return -EINVAL; 3208 return -EINVAL;
3209 3209
3210 if (!ifmsh->pre_value) 3210 if (ifmsh->csa_role == IEEE80211_MESH_CSA_ROLE_NONE) {
3211 ifmsh->pre_value = 1;
3212 else
3213 ifmsh->pre_value++;
3214
3215 if (ifmsh->csa_role == IEEE80211_MESH_CSA_ROLE_NONE)
3216 ifmsh->csa_role = IEEE80211_MESH_CSA_ROLE_INIT; 3211 ifmsh->csa_role = IEEE80211_MESH_CSA_ROLE_INIT;
3212 if (!ifmsh->pre_value)
3213 ifmsh->pre_value = 1;
3214 else
3215 ifmsh->pre_value++;
3216 }
3217 3217
3218 /* see comments in the NL80211_IFTYPE_AP block */ 3218 /* see comments in the NL80211_IFTYPE_AP block */
3219 if (params->count > 1) { 3219 if (params->count > 1) {