From patchwork Tue Sep 3 17:43:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Wunderlich X-Patchwork-Id: 2853356 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 541C09F494 for ; Tue, 3 Sep 2013 17:43:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 35A442041B for ; Tue, 3 Sep 2013 17:43:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0EB262041C for ; Tue, 3 Sep 2013 17:43:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759580Ab3ICRng (ORCPT ); Tue, 3 Sep 2013 13:43:36 -0400 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 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tu-chemnitz.de; s=dkim2010; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=QGLzjmDzg1OSN6gA6CQwxMEysVTp3yfiN6Yqas2S9Dg=; b=Gut8UXN1x2K7YhBy3NpCYkLiNh0xXwBzFxP/PxspD5+uXHWPXqzykNroTymUP4b0b8xjtPBOo4y9B9CzHx0zSqHKRWrX8OGKWj78hGaKADsUddCQGbFWd6y5WC2L4wMvKWWOJMspD8YUDAW9nTDZ/ryGHUOdfF5D5S2N0QVMvMk=; Received: from p4ffe5d4b.dip0.t-ipconnect.de ([79.254.93.75] helo=pandem0nium) by nick.hrz.tu-chemnitz.de with esmtpsa (TLSv1:DHE-RSA-AES128-SHA:128) (Exim 4.80.1) (envelope-from ) id 1VGudX-0006oB-Ag; Tue, 03 Sep 2013 19:43:31 +0200 Received: from dotslash by pandem0nium with local (Exim 4.80) (envelope-from ) id 1VGudV-0006cz-GK; Tue, 03 Sep 2013 19:43:29 +0200 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> X-Mailer: git-send-email 1.7.10.4 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> X-purgate: clean X-purgate-type: clean X-purgate-ID: 154106::1378230211-000004FE-7046ABC7/0-0/0-0 X-Scan-AV: nick.hrz.tu-chemnitz.de; 2013-09-03 19:43:31; d1f17350cf8c743f963d328f523a4603 X-Scan-SA: nick.hrz.tu-chemnitz.de; 2013-09-03 19:43:31; decc09a1645718298527aef65e21987e X-Spam-Score: -1.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=-9.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable 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 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;