]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
mesh: Fix peer link counting when removing a mesh peer
authorYu Wang <yyuwang@codeaurora.org>
Tue, 7 Jul 2020 18:18:47 +0000 (02:18 +0800)
committerJouni Malinen <j@w1.fi>
Wed, 15 Jul 2020 09:00:35 +0000 (12:00 +0300)
When removing a mesh peer with control interface commands (ACCEPT_ACL
DEL_MAC/DENY_ACL ADD_MAC/MESH_PEER_REMOVE) the plink count was not
decreased from its last connection. This resulted in peer link count
leakage and wpa_supplicant rejecting the connections after reaching
max_peer_links (default: 99).

Fix this by decreasing the plink count when removing a mesh peer which
is in PLINK_ESTAB state.

Signed-off-by: Yu Wang <yyuwang@codeaurora.org>
wpa_supplicant/mesh_mpm.c

index ea62abf5b48d44fdc76a8551622b1cdf3b715243..3abbe09d0f048113204378607aa1a54941c1f978 100644 (file)
@@ -533,6 +533,8 @@ static int mesh_mpm_plink_close(struct hostapd_data *hapd, struct sta_info *sta,
        int reason = WLAN_REASON_MESH_PEERING_CANCELLED;
 
        if (sta) {
+               if (sta->plink_state == PLINK_ESTAB)
+                       hapd->num_plinks--;
                wpa_mesh_set_plink_state(wpa_s, sta, PLINK_HOLDING);
                mesh_mpm_send_plink_action(wpa_s, sta, PLINK_CLOSE, reason);
                wpa_printf(MSG_DEBUG, "MPM closing plink sta=" MACSTR,