linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Luis R. Rodriguez" <lrodriguez@atheros.com>
To: Luis Rodriguez <Luis.Rodriguez@Atheros.com>
Cc: Johannes Berg <johannes@sipsolutions.net>,
	Jouni Malinen <Jouni.Malinen@Atheros.com>,
	"linville@tuxdriver.com" <linville@tuxdriver.com>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH] mac80211: do not TX injected frames when not allowed
Date: Sun, 18 Jan 2009 08:04:50 -0800	[thread overview]
Message-ID: <20090118160450.GX29609@tesla> (raw)
In-Reply-To: <20090118153243.GU29609@tesla>

On Sun, Jan 18, 2009 at 07:32:43AM -0800, Luis Rodriguez wrote:
> On Sun, Jan 18, 2009 at 12:45:39AM -0800, Johannes Berg wrote:
> > On Fri, 2009-01-16 at 10:52 -0800, Luis R. Rodriguez wrote:
> > > Monitor mode is able to TX by using injected frames. We should
> > > not allow injected frames to be sent unless allowed by regulatory rules.
> > > Since AP mode uses a monitor interfaces to transmit management frames
> > > we have to take care to not break AP mode as well. Since hostapd
> > > respects 'no-ibss|radar' flags we can make use of the same policy
> > > statically for checking when to disable injected frames. Once AP
> > > mode supports radar detection we should somehow distinguish a
> > > regular monitor mode from an AP's monitor interface.
> >
> > Any proposal for "somehow"? I'm not all that worried about packet
> > injection here.
> 
> I'll send a patch instead. Keep in mind by not applying this you are
> allowing devices to not respect regulatory rules.

How about a monitor flag? Although I am not sure where we'd use this
except if we'd want to change assumptions on regulatory rules for
the interface.

  Luis

diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index 4e7a798..7f65d7e 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -683,6 +683,8 @@ enum nl80211_reg_rule_flags {
  * @NL80211_MNTR_FLAG_OTHER_BSS: disable BSSID filtering
  * @NL80211_MNTR_FLAG_COOK_FRAMES: report frames after processing.
  *	overrides all other flags.
+ * @NL80211_MNTR_FLAG_AP_MGT: this monitor interface is used for AP mode
+ * 	to be able to inject management frames.
  *
  * @__NL80211_MNTR_FLAG_AFTER_LAST: internal use
  * @NL80211_MNTR_FLAG_MAX: highest possible monitor flag
@@ -694,6 +696,7 @@ enum nl80211_mntr_flags {
 	NL80211_MNTR_FLAG_CONTROL,
 	NL80211_MNTR_FLAG_OTHER_BSS,
 	NL80211_MNTR_FLAG_COOK_FRAMES,
+	NL80211_MNTR_FLAG_AP_MGT,
 
 	/* keep last */
 	__NL80211_MNTR_FLAG_AFTER_LAST,
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 6bab7a1..4b85a20 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -255,6 +255,9 @@ struct station_info {
  * @MONITOR_FLAG_CONTROL: pass control frames
  * @MONITOR_FLAG_OTHER_BSS: disable BSSID filtering
  * @MONITOR_FLAG_COOK_FRAMES: report frames after processing
+ * @MONITOR_FLAG_AP_MGT: informs us this monitor interface is
+ *	used by an driver for AP mode to be able to inject management
+ * 	frames.
  */
 enum monitor_flags {
 	MONITOR_FLAG_FCSFAIL		= 1<<NL80211_MNTR_FLAG_FCSFAIL,
@@ -262,6 +265,7 @@ enum monitor_flags {
 	MONITOR_FLAG_CONTROL		= 1<<NL80211_MNTR_FLAG_CONTROL,
 	MONITOR_FLAG_OTHER_BSS		= 1<<NL80211_MNTR_FLAG_OTHER_BSS,
 	MONITOR_FLAG_COOK_FRAMES	= 1<<NL80211_MNTR_FLAG_COOK_FRAMES,
+	MONITOR_FLAG_AP_MGT		= 1<<NL80211_MNTR_FLAG_AP_MGT,
 };
 
 /**
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 2e7f9eb..90e276c 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -533,6 +533,7 @@ static const struct nla_policy mntr_flags_policy[NL80211_MNTR_FLAG_MAX + 1] = {
 	[NL80211_MNTR_FLAG_CONTROL] = { .type = NLA_FLAG },
 	[NL80211_MNTR_FLAG_OTHER_BSS] = { .type = NLA_FLAG },
 	[NL80211_MNTR_FLAG_COOK_FRAMES] = { .type = NLA_FLAG },
+	[NL80211_MNTR_FLAG_AP_MGT] = { .type = NLA_FLAG },
 };
 
 static int parse_monitor_flags(struct nlattr *nla, u32 *mntrflags)

  reply	other threads:[~2009-01-18 16:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-16 18:52 [PATCH] mac80211: do not TX injected frames when not allowed Luis R. Rodriguez
2009-01-18  8:45 ` Johannes Berg
2009-01-18 15:32   ` Luis R. Rodriguez
2009-01-18 16:04     ` Luis R. Rodriguez [this message]
  -- strict thread matches above, loose matches on Subject: below --
2009-01-27  0:22 Luis R. Rodriguez
2009-01-27  8:49 ` Johannes Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090118160450.GX29609@tesla \
    --to=lrodriguez@atheros.com \
    --cc=Jouni.Malinen@Atheros.com \
    --cc=Luis.Rodriguez@Atheros.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).