From patchwork Wed Nov 30 00:06:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 9453265 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 42A126071C for ; Wed, 30 Nov 2016 00:06:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 369AB284C4 for ; Wed, 30 Nov 2016 00:06:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2B0D8284CC; Wed, 30 Nov 2016 00:06:40 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, 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 BDD69284C4 for ; Wed, 30 Nov 2016 00:06:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755466AbcK3AGi (ORCPT ); Tue, 29 Nov 2016 19:06:38 -0500 Received: from mail-pg0-f65.google.com ([74.125.83.65]:33860 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755481AbcK3AGg (ORCPT ); Tue, 29 Nov 2016 19:06:36 -0500 Received: by mail-pg0-f65.google.com with SMTP id e9so17758184pgc.1 for ; Tue, 29 Nov 2016 16:06:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=4wfAEZfCPXu/cV3AV6VOAoJ5JyUq50QWw5IIfNpGE4c=; b=w6dTjUuefxUjXHRQQn3wXVcHA3rZs8ymuMB4rwo9plWzgYhVnvBdprGyAuLsm8ZRbX u1yjeUk8LDZ5QgROSVVZRwilBXG0N+QYZR3JiEY3q38lyKPDebJ0hmz67W6gfk2ayXzr rwTk0LU7cIkqZWO2pve9QaFetSECkMqk1Fs3m8NdG/lo71nwEhOkQg9eWioCQw0Gp49H M3Sl+k2MwyrBrTBiE89TAO3sWgwgshs/O1yj+DLpdfLs78WtUUA9qtGUfnu9f4FwRbW6 R6HL6jZB92nOHFyHNb1BW3Jsx1P32IVWJfEtrgaIO3ivk7/wcKHha/QCkAEVML9YDaxv ATlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=4wfAEZfCPXu/cV3AV6VOAoJ5JyUq50QWw5IIfNpGE4c=; b=NZHcF0W1IBNLUfLKmnd5k+DFF1hCwtnZtiiSOw3UzKpLtY+ElhqTYDsq1pPM0jxE9r NRa0x4OLH/C6giEQKYYCQaacOe7A4QEHSn5e2o/wNg+yWq/ha5c39jtWj4qCv7qT/Qkg WlWqrUYKZ7e5Jd5SeneeHHFWGxsnmA4qU0ESGlv9v0A0Ehx2tLYyMTEMBfNN/dz9HdhK 3TLsetkI4DX2EBBvsxX4lRnRGgfQffu3HJWcBvqw+TxBNka5tI4sPCzH2IB5hLCN2cUt jEl+iBF2xA6Xpnr41tdBem/hvpPuIqaYbN8Dowvmul229gAIYDEFyiMwzifpagisRogd DMJA== X-Gm-Message-State: AKaTC00sIUD5oOyd9fxGxhuFBt3Xv2cVhWzjB61PFYnYWpUnvwCWg7hCCixd+jHQXKYXcw== X-Received: by 10.98.10.198 with SMTP id 67mr31111653pfk.157.1480464378435; Tue, 29 Nov 2016 16:06:18 -0800 (PST) Received: from localhost.localdomain (p0348c7.kngwnt01.ap.so-net.ne.jp. [121.3.72.199]) by smtp.gmail.com with ESMTPSA id o126sm79726147pga.34.2016.11.29.16.06.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 29 Nov 2016 16:06:18 -0800 (PST) From: Masashi Honma To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, me@bobcopeland.com, Masashi Honma Subject: [PATCH] mac80211: Suppress NEW_PEER_CANDIDATE event if no room Date: Wed, 30 Nov 2016 09:06:04 +0900 Message-Id: <1480464364-5054-1-git-send-email-masashi.honma@gmail.com> X-Mailer: git-send-email 2.7.4 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 Previously, kernel sends NEW_PEER_CANDIDATE event to user land even if the found peer does not have any room to accept other peer. This causes continuous connection trials. Signed-off-by: Masashi Honma --- net/mac80211/mesh_plink.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c index 7fcdcf6..fcba70e5 100644 --- a/net/mac80211/mesh_plink.c +++ b/net/mac80211/mesh_plink.c @@ -505,12 +505,14 @@ mesh_sta_info_alloc(struct ieee80211_sub_if_data *sdata, u8 *addr, /* Userspace handles station allocation */ if (sdata->u.mesh.user_mpm || - sdata->u.mesh.security & IEEE80211_MESH_SEC_AUTHED) - cfg80211_notify_new_peer_candidate(sdata->dev, addr, - elems->ie_start, - elems->total_len, - GFP_KERNEL); - else + sdata->u.mesh.security & IEEE80211_MESH_SEC_AUTHED) { + if (mesh_peer_accepts_plinks(elems) && + mesh_plink_availables(sdata)) + cfg80211_notify_new_peer_candidate(sdata->dev, addr, + elems->ie_start, + elems->total_len, + GFP_KERNEL); + } else sta = __mesh_sta_info_alloc(sdata, addr); return sta;