From patchwork Fri Apr 17 17:30:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chun-Yeow Yeoh X-Patchwork-Id: 6234941 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 14F63BF4A6 for ; Fri, 17 Apr 2015 17:30:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 50F6520397 for ; Fri, 17 Apr 2015 17:30:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6CB8320394 for ; Fri, 17 Apr 2015 17:30:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933940AbbDQRaX (ORCPT ); Fri, 17 Apr 2015 13:30:23 -0400 Received: from mail-pd0-f182.google.com ([209.85.192.182]:35910 "EHLO mail-pd0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933937AbbDQRaV (ORCPT ); Fri, 17 Apr 2015 13:30:21 -0400 Received: by pdea3 with SMTP id a3so134444319pde.3 for ; Fri, 17 Apr 2015 10:30:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=Qg3GNK6zOpwqmLU5BOZsBDIY/ks4HZeLN+Ofmm7Ll6k=; b=BBo8QdNvZRPu8OeUeLI5+rQfypJ4zWseQgycrGG4bAd5/Z5mwnDk+ugwEvaxLRDqkF bGHQ/tVxQQ9BAGSgz33LDcf3sSO4EHL/zGrEsWUMRB+xXw+quCj0bOBEQ/9bBEYRiO3a sEm+bhocP0CskI+TsZh1iztvPtT/wRxmytSgIGxols0Q9G1mYxtHtNU5iVrwvOv1D58I WNEcaNyvPwbVM1sJ0UiC6q4nw9s7ss+BFvvwaYQYPvaWHY7DFWssbpud0yPuw9G5c2xT qLlO+IYE5tTu/JXNTgyyDc1ZrjSeyTcXHnZPpxkbp1VKMFhcNeK6LXoCGDDLmNRa6Cfv WrEQ== X-Received: by 10.68.143.135 with SMTP id se7mr7427560pbb.48.1429291821258; Fri, 17 Apr 2015 10:30:21 -0700 (PDT) Received: from nga.lan ([175.139.62.239]) by mx.google.com with ESMTPSA id da10sm10763302pac.42.2015.04.17.10.30.17 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 17 Apr 2015 10:30:19 -0700 (PDT) From: Chun-Yeow Yeoh To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net, Chun-Yeow Yeoh Subject: [PATCH v2] cfg80211: allow the plink state blocking for user managed mesh Date: Sat, 18 Apr 2015 01:30:02 +0800 Message-Id: <1429291802-14168-1-git-send-email-yeohchunyeow@gmail.com> X-Mailer: git-send-email 2.3.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP wpa_supplicant or authsae handles the mesh peering in user space, but the plink state is still managed in kernel space. Currently, there is no implementation by wpa_supplicant or authsae to block the plink state after it is set to ESTAB. By applying this patch, we can use the "iw mesh0 station set plink_action block" to block the peer mesh STA. This is useful for experimenting purposes. Signed-off-by: Chun-Yeow Yeoh v2: respin the commit log (Johannes) --- net/wireless/nl80211.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index dd78445..8a33bba 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -4061,7 +4061,8 @@ int cfg80211_check_station_change(struct wiphy *wiphy, return -EINVAL; break; case CFG80211_STA_MESH_PEER_USER: - if (params->plink_action != NL80211_PLINK_ACTION_NO_ACTION) + if (params->plink_action != NL80211_PLINK_ACTION_NO_ACTION && + params->plink_action != NL80211_PLINK_ACTION_BLOCK) return -EINVAL; break; }