diff mbox

[1/4] nl80211: allow CAC only if no operation is going on

Message ID 1378230201-25446-2-git-send-email-siwu@hrz.tu-chemnitz.de (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Simon Wunderlich Sept. 3, 2013, 5:43 p.m. UTC
A CAC should fail if it is triggered while the interface is already
running.

Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
---
 net/wireless/nl80211.c |    3 +++
 1 file changed, 3 insertions(+)

Comments

Johannes Berg Oct. 1, 2013, 11:06 a.m. UTC | #1
On Tue, 2013-09-03 at 19:43 +0200, Simon Wunderlich wrote:
> A CAC should fail if it is triggered while the interface is already
> running.

Applied, though this is a bit questionable - it forces every driver
implementing this to have the same carrier semantics as mac80211. That
might very well be a good thing, but those semantics aren't really
documented.

johannes

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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;