Commit b39c48fa authored by Javier Cardona's avatar Javier Cardona Committed by John W. Linville

nl80211/mac80211: let userspace authenticate stations

Signed-off-by: default avatarJavier Cardona <javier@cozybit.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 5cff5e01
...@@ -1174,6 +1174,7 @@ enum nl80211_iftype { ...@@ -1174,6 +1174,7 @@ enum nl80211_iftype {
* with short barker preamble * with short barker preamble
* @NL80211_STA_FLAG_WME: station is WME/QoS capable * @NL80211_STA_FLAG_WME: station is WME/QoS capable
* @NL80211_STA_FLAG_MFP: station uses management frame protection * @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_MAX: highest station flag number currently defined
* @__NL80211_STA_FLAG_AFTER_LAST: internal use * @__NL80211_STA_FLAG_AFTER_LAST: internal use
*/ */
...@@ -1183,6 +1184,7 @@ enum nl80211_sta_flags { ...@@ -1183,6 +1184,7 @@ enum nl80211_sta_flags {
NL80211_STA_FLAG_SHORT_PREAMBLE, NL80211_STA_FLAG_SHORT_PREAMBLE,
NL80211_STA_FLAG_WME, NL80211_STA_FLAG_WME,
NL80211_STA_FLAG_MFP, NL80211_STA_FLAG_MFP,
NL80211_STA_FLAG_AUTHENTICATED,
/* keep last */ /* keep last */
__NL80211_STA_FLAG_AFTER_LAST, __NL80211_STA_FLAG_AFTER_LAST,
......
...@@ -686,6 +686,12 @@ static void sta_apply_parameters(struct ieee80211_local *local, ...@@ -686,6 +686,12 @@ static void sta_apply_parameters(struct ieee80211_local *local,
if (set & BIT(NL80211_STA_FLAG_MFP)) if (set & BIT(NL80211_STA_FLAG_MFP))
sta->flags |= WLAN_STA_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); spin_unlock_irqrestore(&sta->flaglock, flags);
/* /*
......
...@@ -1925,6 +1925,7 @@ static const struct nla_policy sta_flags_policy[NL80211_STA_FLAG_MAX + 1] = { ...@@ -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_SHORT_PREAMBLE] = { .type = NLA_FLAG },
[NL80211_STA_FLAG_WME] = { .type = NLA_FLAG }, [NL80211_STA_FLAG_WME] = { .type = NLA_FLAG },
[NL80211_STA_FLAG_MFP] = { .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, static int parse_station_flags(struct genl_info *info,
...@@ -2284,7 +2285,9 @@ static int nl80211_set_station(struct sk_buff *skb, struct genl_info *info) ...@@ -2284,7 +2285,9 @@ static int nl80211_set_station(struct sk_buff *skb, struct genl_info *info)
err = -EINVAL; err = -EINVAL;
if (params.supported_rates) if (params.supported_rates)
err = -EINVAL; err = -EINVAL;
if (params.sta_flags_mask) if (params.sta_flags_mask &
~(BIT(NL80211_STA_FLAG_AUTHENTICATED) |
BIT(NL80211_STA_FLAG_AUTHORIZED)))
err = -EINVAL; err = -EINVAL;
break; break;
default: default:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment