diff options
author | Antonio Quartulli <ordex@autistici.org> | 2012-01-31 14:25:47 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-02-06 14:53:10 -0500 |
commit | 267335d63b808dc861f3a4dc81a605489a8a13ac (patch) | |
tree | 2f114b6f45147d17ea4cbd57cf33289a57248a1b /net/wireless/nl80211.c | |
parent | 3eda95de19e1781612091869e866a5014257f462 (diff) |
cfg80211/mac80211: userspace peer authorization in IBSS
If the IBSS network is RSN-protected, let userspace authorize the stations
instead of adding them as AUTHORIZED by default.
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless/nl80211.c')
-rw-r--r-- | net/wireless/nl80211.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index e1fd1bf90729..f1681e2c5949 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -2654,13 +2654,6 @@ static int nl80211_set_station(struct sk_buff *skb, struct genl_info *info) | |||
2654 | break; | 2654 | break; |
2655 | case NL80211_IFTYPE_P2P_CLIENT: | 2655 | case NL80211_IFTYPE_P2P_CLIENT: |
2656 | case NL80211_IFTYPE_STATION: | 2656 | case NL80211_IFTYPE_STATION: |
2657 | /* disallow things sta doesn't support */ | ||
2658 | if (params.plink_action) | ||
2659 | return -EINVAL; | ||
2660 | if (params.ht_capa) | ||
2661 | return -EINVAL; | ||
2662 | if (params.listen_interval >= 0) | ||
2663 | return -EINVAL; | ||
2664 | /* | 2657 | /* |
2665 | * Don't allow userspace to change the TDLS_PEER flag, | 2658 | * Don't allow userspace to change the TDLS_PEER flag, |
2666 | * but silently ignore attempts to change it since we | 2659 | * but silently ignore attempts to change it since we |
@@ -2668,7 +2661,15 @@ static int nl80211_set_station(struct sk_buff *skb, struct genl_info *info) | |||
2668 | * to change the flag. | 2661 | * to change the flag. |
2669 | */ | 2662 | */ |
2670 | params.sta_flags_mask &= ~BIT(NL80211_STA_FLAG_TDLS_PEER); | 2663 | params.sta_flags_mask &= ~BIT(NL80211_STA_FLAG_TDLS_PEER); |
2671 | 2664 | /* fall through */ | |
2665 | case NL80211_IFTYPE_ADHOC: | ||
2666 | /* disallow things sta doesn't support */ | ||
2667 | if (params.plink_action) | ||
2668 | return -EINVAL; | ||
2669 | if (params.ht_capa) | ||
2670 | return -EINVAL; | ||
2671 | if (params.listen_interval >= 0) | ||
2672 | return -EINVAL; | ||
2672 | /* reject any changes other than AUTHORIZED */ | 2673 | /* reject any changes other than AUTHORIZED */ |
2673 | if (params.sta_flags_mask & ~BIT(NL80211_STA_FLAG_AUTHORIZED)) | 2674 | if (params.sta_flags_mask & ~BIT(NL80211_STA_FLAG_AUTHORIZED)) |
2674 | return -EINVAL; | 2675 | return -EINVAL; |
@@ -4802,6 +4803,9 @@ static int nl80211_join_ibss(struct sk_buff *skb, struct genl_info *info) | |||
4802 | return PTR_ERR(connkeys); | 4803 | return PTR_ERR(connkeys); |
4803 | } | 4804 | } |
4804 | 4805 | ||
4806 | ibss.control_port = | ||
4807 | nla_get_flag(info->attrs[NL80211_ATTR_CONTROL_PORT]); | ||
4808 | |||
4805 | err = cfg80211_join_ibss(rdev, dev, &ibss, connkeys); | 4809 | err = cfg80211_join_ibss(rdev, dev, &ibss, connkeys); |
4806 | if (err) | 4810 | if (err) |
4807 | kfree(connkeys); | 4811 | kfree(connkeys); |