wifi: mac80211: mesh_plink: fix matches_local logic
authorJohannes Berg <johannes.berg@intel.com>
Mon, 11 Dec 2023 07:05:31 +0000 (09:05 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 12 Dec 2023 09:14:57 +0000 (10:14 +0100)
During refactoring the "else" here got lost, add it back.

Fixes: c99a89edb106 ("mac80211: factor out plink event gathering")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20231211085121.795480fa0e0b.I017d501196a5bbdcd9afd33338d342d6fe1edd79@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/mesh_plink.c

index 2da6ecf0077d2ea8cb6e01461891f7bf3494123d..28bf794f67f8c4fb2c9ae549ea3b5c3b3be08b84 100644 (file)
@@ -1068,8 +1068,8 @@ mesh_plink_get_event(struct ieee80211_sub_if_data *sdata,
        case WLAN_SP_MESH_PEERING_OPEN:
                if (!matches_local)
                        event = OPN_RJCT;
-               if (!mesh_plink_free_count(sdata) ||
-                   (sta->mesh->plid && sta->mesh->plid != plid))
+               else if (!mesh_plink_free_count(sdata) ||
+                        (sta->mesh->plid && sta->mesh->plid != plid))
                        event = OPN_IGNR;
                else
                        event = OPN_ACPT;
@@ -1077,9 +1077,9 @@ mesh_plink_get_event(struct ieee80211_sub_if_data *sdata,
        case WLAN_SP_MESH_PEERING_CONFIRM:
                if (!matches_local)
                        event = CNF_RJCT;
-               if (!mesh_plink_free_count(sdata) ||
-                   sta->mesh->llid != llid ||
-                   (sta->mesh->plid && sta->mesh->plid != plid))
+               else if (!mesh_plink_free_count(sdata) ||
+                        sta->mesh->llid != llid ||
+                        (sta->mesh->plid && sta->mesh->plid != plid))
                        event = CNF_IGNR;
                else
                        event = CNF_ACPT;