From patchwork Tue Jun 28 11:13:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Machani, Yaniv" X-Patchwork-Id: 9202923 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 702AD60757 for ; Tue, 28 Jun 2016 11:12:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 60B7828600 for ; Tue, 28 Jun 2016 11:12:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 551BC28602; Tue, 28 Jun 2016 11:12:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BE02828600 for ; Tue, 28 Jun 2016 11:12:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752370AbcF1LL0 (ORCPT ); Tue, 28 Jun 2016 07:11:26 -0400 Received: from bear.ext.ti.com ([198.47.19.11]:56637 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752353AbcF1LLX (ORCPT ); Tue, 28 Jun 2016 07:11:23 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id u5SBBLFD012219; Tue, 28 Jun 2016 06:11:21 -0500 Received: from DLEE70.ent.ti.com (dlemailx.itg.ti.com [157.170.170.113]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id u5SBBLYh029879; Tue, 28 Jun 2016 06:11:21 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.294.0; Tue, 28 Jun 2016 06:11:21 -0500 Received: from wlsrv.emea.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id u5SBAkOo026495; Tue, 28 Jun 2016 06:11:20 -0500 From: Yaniv Machani To: , Johannes Berg , "David S . Miller" , , CC: Meirav Kama Subject: [PATCH 4/4] mac80211: sta_info: max_peers reached falsely Date: Tue, 28 Jun 2016 14:13:07 +0300 Message-ID: <20160628111307.8784-5-yanivma@ti.com> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20160628111307.8784-4-yanivma@ti.com> References: <20160628111307.8784-1-yanivma@ti.com> <20160628111307.8784-2-yanivma@ti.com> <20160628111307.8784-3-yanivma@ti.com> <20160628111307.8784-4-yanivma@ti.com> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Meirav Kama Issue happened when receiving delete_sta command without changing plink_state from ESTAB to HOLDING before. When receiving delete_sta command for mesh interface verify plink_state is not ESTAB and if so, decrease plink count and update beacon. Signed-off-by: Meirav Kama Acked-by: Yaniv Machani --- net/mac80211/sta_info.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c index 76b737d..1ce6320 100644 --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c @@ -1009,11 +1009,25 @@ int sta_info_destroy_addr_bss(struct ieee80211_sub_if_data *sdata, { struct sta_info *sta; int ret; +#ifdef CONFIG_MAC80211_MESH + bool dec_links = false; +#endif mutex_lock(&sdata->local->sta_mtx); sta = sta_info_get_bss(sdata, addr); +#ifdef CONFIG_MAC80211_MESH + if (sdata->vif.type == NL80211_IFTYPE_MESH_POINT && + sta->mesh->plink_state == NL80211_PLINK_ESTAB) + dec_links = true; +#endif ret = __sta_info_destroy(sta); mutex_unlock(&sdata->local->sta_mtx); +#ifdef CONFIG_MAC80211_MESH + if (dec_links) { + mesh_plink_dec_estab_count(sdata); + ieee80211_mbss_info_change_notify(sdata, BSS_CHANGED_BEACON); + } +#endif return ret; }