From: Thomas Pedersen <thomas@cozybit.com>
To: linux-wireless@vger.kernel.org
Cc: johannes@sipsolutions.net, javier@cozybit.com, linville@tuxdriver.com
Subject: [PATCH v7 05/10] nl80211: let userspace authenticate stations
Date: Mon, 4 Apr 2011 18:15:35 -0700 [thread overview]
Message-ID: <1301966140-26080-6-git-send-email-thomas@cozybit.com> (raw)
In-Reply-To: <1301966140-26080-1-git-send-email-thomas@cozybit.com>
From: Javier Cardona <javier@cozybit.com>
Signed-off-by: Javier Cardona <javier@cozybit.com>
---
include/linux/nl80211.h | 2 ++
net/mac80211/cfg.c | 6 ++++++
net/wireless/nl80211.c | 5 ++++-
3 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index 59aa809..43c620e 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -1174,6 +1174,7 @@ enum nl80211_iftype {
* with short barker preamble
* @NL80211_STA_FLAG_WME: station is WME/QoS capable
* @NL80211_STA_FLAG_MFP: station uses management frame protection
+ * @NL80211_STA_FLAG_AUTHENTICATED: station is authenticated
* @NL80211_STA_FLAG_MAX: highest station flag number currently defined
* @__NL80211_STA_FLAG_AFTER_LAST: internal use
*/
@@ -1183,6 +1184,7 @@ enum nl80211_sta_flags {
NL80211_STA_FLAG_SHORT_PREAMBLE,
NL80211_STA_FLAG_WME,
NL80211_STA_FLAG_MFP,
+ NL80211_STA_FLAG_AUTHENTICATED,
/* keep last */
__NL80211_STA_FLAG_AFTER_LAST,
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 4f73085..c57d653 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -675,6 +675,12 @@ static void sta_apply_parameters(struct ieee80211_local *local,
if (set & BIT(NL80211_STA_FLAG_MFP))
sta->flags |= WLAN_STA_MFP;
}
+
+ if (mask & BIT(NL80211_STA_FLAG_AUTHENTICATED)) {
+ sta->flags &= ~WLAN_STA_AUTH;
+ if (set & BIT(NL80211_STA_FLAG_AUTHENTICATED))
+ sta->flags |= WLAN_STA_AUTH;
+ }
spin_unlock_irqrestore(&sta->flaglock, flags);
/*
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index f98db56..dba1a21 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -1925,6 +1925,7 @@ static const struct nla_policy sta_flags_policy[NL80211_STA_FLAG_MAX + 1] = {
[NL80211_STA_FLAG_SHORT_PREAMBLE] = { .type = NLA_FLAG },
[NL80211_STA_FLAG_WME] = { .type = NLA_FLAG },
[NL80211_STA_FLAG_MFP] = { .type = NLA_FLAG },
+ [NL80211_STA_FLAG_AUTHENTICATED] = { .type = NLA_FLAG },
};
static int parse_station_flags(struct genl_info *info,
@@ -2265,7 +2266,9 @@ static int nl80211_set_station(struct sk_buff *skb, struct genl_info *info)
err = -EINVAL;
if (params.supported_rates)
err = -EINVAL;
- if (params.sta_flags_mask)
+ if (params.sta_flags_mask &
+ ~(BIT(NL80211_STA_FLAG_AUTHENTICATED) |
+ BIT(NL80211_STA_FLAG_AUTHORIZED)))
err = -EINVAL;
break;
default:
--
1.7.4.1
next prev parent reply other threads:[~2011-04-05 2:16 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-05 1:15 [PATCH v7 00/10] mesh security enhancements Thomas Pedersen
2011-04-05 1:15 ` [PATCH v7 01/10] nl80211: rename NL80211_MESH_SETUP_VENDOR_PATH_SEL_IE Thomas Pedersen
2011-04-06 13:31 ` Stanislaw Gruszka
2011-04-07 19:17 ` Thomas Pedersen
2011-04-05 1:15 ` [PATCH v7 02/10] nl80211: Add userspace authentication flag to mesh setup Thomas Pedersen
2011-04-05 1:15 ` [PATCH v7 03/10] mac80211: Support userspace mesh authentication Thomas Pedersen
2011-04-05 7:28 ` Johannes Berg
2011-04-05 1:15 ` [PATCH v7 04/10] mac80211: ignore peers if security is enabled for this mesh Thomas Pedersen
2011-04-05 1:15 ` Thomas Pedersen [this message]
2011-04-05 1:15 ` [PATCH v7 06/10] mac80211: Let user space receive and send mesh auth/deauth frames Thomas Pedersen
2011-04-05 1:15 ` [PATCH v7 07/10] mac80211: ignore peer link requests from unauthenticated stations Thomas Pedersen
2011-04-05 1:15 ` [PATCH v7 08/10] mac80211: Perform PLINK_ACTION on new station Thomas Pedersen
2011-04-05 1:15 ` [PATCH v7 09/10] nl80211: New notification to discover mesh peer candidates Thomas Pedersen
2011-04-05 1:15 ` [PATCH v7 10/10] mac80211: send notification on new peer candidate for our secure mesh Thomas Pedersen
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=1301966140-26080-6-git-send-email-thomas@cozybit.com \
--to=thomas@cozybit.com \
--cc=javier@cozybit.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).