Return-path: Received: from nick.hrz.tu-chemnitz.de ([134.109.228.11]:51719 "EHLO nick.hrz.tu-chemnitz.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757827Ab3ICRne (ORCPT ); Tue, 3 Sep 2013 13:43:34 -0400 From: Simon Wunderlich To: linux-wireless@vger.kernel.org Cc: Johannes Berg , Mathias Kretschmer , Simon Wunderlich Subject: [PATCH 1/4] nl80211: allow CAC only if no operation is going on Date: Tue, 3 Sep 2013 19:43:18 +0200 Message-Id: <1378230201-25446-2-git-send-email-siwu@hrz.tu-chemnitz.de> (sfid-20130903_194340_423135_C26CF35A) In-Reply-To: <1378230201-25446-1-git-send-email-siwu@hrz.tu-chemnitz.de> References: <1378230201-25446-1-git-send-email-siwu@hrz.tu-chemnitz.de> Sender: linux-wireless-owner@vger.kernel.org List-ID: A CAC should fail if it is triggered while the interface is already running. Signed-off-by: Simon Wunderlich Signed-off-by: Mathias Kretschmer --- net/wireless/nl80211.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index da8de5b..cbbef88 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -5591,6 +5591,9 @@ static int nl80211_start_radar_detection(struct sk_buff *skb, if (err) return err; + if (netif_carrier_ok(dev)) + return -EBUSY; + if (wdev->cac_started) return -EBUSY; -- 1.7.10.4