From patchwork Mon Dec 9 10:28:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Cavallari X-Patchwork-Id: 11278999 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C3AFB930 for ; Mon, 9 Dec 2019 10:28:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AA6A6207FD for ; Mon, 9 Dec 2019 10:28:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727482AbfLIK2z (ORCPT ); Mon, 9 Dec 2019 05:28:55 -0500 Received: from mout.kundenserver.de ([212.227.17.13]:33129 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727409AbfLIK2x (ORCPT ); Mon, 9 Dec 2019 05:28:53 -0500 Received: from evilbit.green-communications.fr ([92.154.77.116]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.184]) with ESMTPSA (Nemesis) id 1MTREY-1iAbuP1ZSW-00TjfQ; Mon, 09 Dec 2019 11:28:49 +0100 From: Nicolas Cavallari To: =?utf-8?q?Krzysztof_Ha=C5=82asa?= , Johannes Berg Cc: linux-wireless@vger.kernel.org, Kalle Valo Subject: [RFC PATCH v1 4/4] nl80211: Allow deleting stations in ibss mode to reset their state. Date: Mon, 9 Dec 2019 11:28:09 +0100 Message-Id: <20191209102808.12014-5-nicolas.cavallari@green-communications.fr> X-Mailer: git-send-email 2.24.0 In-Reply-To: References: MIME-Version: 1.0 X-Provags-ID: V03:K1:T8maCSyhvPavolayW/MJ+YJXm/7c1Rgd+tqDj6pc/ZbOyoROH2M E/DrYCxw7iglert2qOBBznvHIglky8X1LhlWULY0fMI9h3xXzzJOjczb9WQZgk231nv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Y66Gvl0RSRpi7dI8NFzNYomye0mqDN8SKdVDWr6gqR29QGWer Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Sometimes, userspace is able to detect that a peer silently lost its state (like, if the peer reboots). wpa_supplicant does this for IBSS-RSN and currently only resets the key of the peer so that it can attempt another handshake. However, the kernel also hold state about the station, such as BA sessions, probe response parameters and the like. They also need to be resetted correctly. This patch allow userspace to use NL80211_CMD_DEL_STATION in IBSS mode, which should send a deauth and reset the state of the station, just like in mesh point mode. This has successfully been tested with mac80211/ath9k. Drivers that do not support it should just return an error, so that userspace can fall back to the old methods. Signed-off-by: Nicolas Cavallari --- 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 da5262b2298b..82046c990a2a 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -6073,7 +6073,8 @@ static int nl80211_del_station(struct sk_buff *skb, struct genl_info *info) if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP && dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP_VLAN && dev->ieee80211_ptr->iftype != NL80211_IFTYPE_MESH_POINT && - dev->ieee80211_ptr->iftype != NL80211_IFTYPE_P2P_GO) + dev->ieee80211_ptr->iftype != NL80211_IFTYPE_P2P_GO && + dev->ieee80211_ptr->iftype != NL80211_IFTYPE_ADHOC) return -EINVAL; if (!rdev->ops->del_station)