From: Chun-Yeow Yeoh Date: Wed, 22 Jan 2014 06:53:04 +0000 (+0800) Subject: mac80211: fix the increment of mesh precedence value X-Git-Tag: accepted/tizen/common/20141203.182822~316^2~18^2^2~47^2~86 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c782bf8caae59a6cdd17ed1b99c126167dae49b2;p=platform%2Fkernel%2Flinux-arm64.git 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 Signed-off-by: Johannes Berg --- diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 032081c..e948b38 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, params->chandef.chan->band) return -EINVAL; - if (!ifmsh->pre_value) - ifmsh->pre_value = 1; - else - ifmsh->pre_value++; - - if (ifmsh->csa_role == IEEE80211_MESH_CSA_ROLE_NONE) + if (ifmsh->csa_role == IEEE80211_MESH_CSA_ROLE_NONE) { ifmsh->csa_role = IEEE80211_MESH_CSA_ROLE_INIT; + if (!ifmsh->pre_value) + ifmsh->pre_value = 1; + else + ifmsh->pre_value++; + } /* see comments in the NL80211_IFTYPE_AP block */ if (params->count > 1) {