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>
This commit is contained in:
parent
36c9bb29bf
commit
58506eba78
|
@ -821,33 +821,25 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata,
|
||||||
|
|
||||||
/* Now we will figure out the appropriate event... */
|
/* Now we will figure out the appropriate event... */
|
||||||
event = PLINK_UNDEFINED;
|
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)
|
if (!sta)
|
||||||
event = OPN_ACPT;
|
event = OPN_ACPT;
|
||||||
else if (matches_local) {
|
else {
|
||||||
switch (ftype) {
|
switch (ftype) {
|
||||||
case WLAN_SP_MESH_PEERING_OPEN:
|
case WLAN_SP_MESH_PEERING_OPEN:
|
||||||
if (!mesh_plink_free_count(sdata) ||
|
if (!matches_local)
|
||||||
(sta->plid && sta->plid != plid))
|
event = OPN_RJCT;
|
||||||
|
else if (!mesh_plink_free_count(sdata) ||
|
||||||
|
(sta->plid && sta->plid != plid))
|
||||||
event = OPN_IGNR;
|
event = OPN_IGNR;
|
||||||
else
|
else
|
||||||
event = OPN_ACPT;
|
event = OPN_ACPT;
|
||||||
break;
|
break;
|
||||||
case WLAN_SP_MESH_PEERING_CONFIRM:
|
case WLAN_SP_MESH_PEERING_CONFIRM:
|
||||||
if (!mesh_plink_free_count(sdata) ||
|
if (!matches_local)
|
||||||
(sta->llid != llid || sta->plid != plid))
|
event = CNF_RJCT;
|
||||||
|
else if (!mesh_plink_free_count(sdata) ||
|
||||||
|
(sta->llid != llid || sta->plid != plid))
|
||||||
event = CNF_IGNR;
|
event = CNF_IGNR;
|
||||||
else
|
else
|
||||||
event = CNF_ACPT;
|
event = CNF_ACPT;
|
||||||
|
|
Loading…
Reference in New Issue