summaryrefslogtreecommitdiffstats
path: root/net/mac80211/mesh_plink.c
diff options
context:
space:
mode:
authorBob Copeland <me@bobcopeland.com>2013-11-05 11:16:55 -0800
committerJohannes Berg <johannes.berg@intel.com>2013-11-25 20:50:05 +0100
commit58506eba784a0944e4c92876b18aacbaad178be3 (patch)
treeed896dd6db7f37aec02374b3280b6ca7c93bb206 /net/mac80211/mesh_plink.c
parent36c9bb29bfad5c43327aa7b8b912ff8dca68416c (diff)
downloadlinux-58506eba784a0944e4c92876b18aacbaad178be3.tar.bz2
mac80211: mesh_plink: collapse the two switch statements together
The matches_local check can just be done when looking at the individual action types. Signed-off-by: Bob Copeland <bob@cozybit.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/mesh_plink.c')
-rw-r--r--net/mac80211/mesh_plink.c26
1 files changed, 9 insertions, 17 deletions
diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c
index 36b6cfffa6fb..8e2339514670 100644
--- a/net/mac80211/mesh_plink.c
+++ b/net/mac80211/mesh_plink.c
@@ -821,33 +821,25 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata,
/* Now we will figure out the appropriate event... */
event = PLINK_UNDEFINED;
- if (!matches_local) {
- switch (ftype) {
- case WLAN_SP_MESH_PEERING_OPEN:
- event = OPN_RJCT;
- break;
- case WLAN_SP_MESH_PEERING_CONFIRM:
- event = CNF_RJCT;
- break;
- default:
- break;
- }
- }
if (!sta)
event = OPN_ACPT;
- else if (matches_local) {
+ else {
switch (ftype) {
case WLAN_SP_MESH_PEERING_OPEN:
- if (!mesh_plink_free_count(sdata) ||
- (sta->plid && sta->plid != plid))
+ if (!matches_local)
+ event = OPN_RJCT;
+ else if (!mesh_plink_free_count(sdata) ||
+ (sta->plid && sta->plid != plid))
event = OPN_IGNR;
else
event = OPN_ACPT;
break;
case WLAN_SP_MESH_PEERING_CONFIRM:
- if (!mesh_plink_free_count(sdata) ||
- (sta->llid != llid || sta->plid != plid))
+ if (!matches_local)
+ event = CNF_RJCT;
+ else if (!mesh_plink_free_count(sdata) ||
+ (sta->llid != llid || sta->plid != plid))
event = CNF_IGNR;
else
event = CNF_ACPT;