diff options
Diffstat (limited to 'net/wireless/nl80211.c')
-rw-r--r-- | net/wireless/nl80211.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 49f5ca35e787..85a23de7bff3 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -136,6 +136,8 @@ static const struct nla_policy nl80211_policy[NL80211_ATTR_MAX+1] = { | |||
136 | .len = sizeof(struct nl80211_sta_flag_update), | 136 | .len = sizeof(struct nl80211_sta_flag_update), |
137 | }, | 137 | }, |
138 | [NL80211_ATTR_CONTROL_PORT] = { .type = NLA_FLAG }, | 138 | [NL80211_ATTR_CONTROL_PORT] = { .type = NLA_FLAG }, |
139 | [NL80211_ATTR_CONTROL_PORT_ETHERTYPE] = { .type = NLA_U16 }, | ||
140 | [NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT] = { .type = NLA_FLAG }, | ||
139 | [NL80211_ATTR_PRIVACY] = { .type = NLA_FLAG }, | 141 | [NL80211_ATTR_PRIVACY] = { .type = NLA_FLAG }, |
140 | [NL80211_ATTR_CIPHER_SUITE_GROUP] = { .type = NLA_U32 }, | 142 | [NL80211_ATTR_CIPHER_SUITE_GROUP] = { .type = NLA_U32 }, |
141 | [NL80211_ATTR_WPA_VERSIONS] = { .type = NLA_U32 }, | 143 | [NL80211_ATTR_WPA_VERSIONS] = { .type = NLA_U32 }, |
@@ -474,6 +476,9 @@ static int nl80211_send_wiphy(struct sk_buff *msg, u32 pid, u32 seq, int flags, | |||
474 | NLA_PUT_U8(msg, NL80211_ATTR_MAX_NUM_PMKIDS, | 476 | NLA_PUT_U8(msg, NL80211_ATTR_MAX_NUM_PMKIDS, |
475 | dev->wiphy.max_num_pmkids); | 477 | dev->wiphy.max_num_pmkids); |
476 | 478 | ||
479 | if (dev->wiphy.flags & WIPHY_FLAG_CONTROL_PORT_PROTOCOL) | ||
480 | NLA_PUT_FLAG(msg, NL80211_ATTR_CONTROL_PORT_ETHERTYPE); | ||
481 | |||
477 | nl_modes = nla_nest_start(msg, NL80211_ATTR_SUPPORTED_IFTYPES); | 482 | nl_modes = nla_nest_start(msg, NL80211_ATTR_SUPPORTED_IFTYPES); |
478 | if (!nl_modes) | 483 | if (!nl_modes) |
479 | goto nla_put_failure; | 484 | goto nla_put_failure; |
@@ -3691,7 +3696,8 @@ unlock_rtnl: | |||
3691 | return err; | 3696 | return err; |
3692 | } | 3697 | } |
3693 | 3698 | ||
3694 | static int nl80211_crypto_settings(struct genl_info *info, | 3699 | static int nl80211_crypto_settings(struct cfg80211_registered_device *rdev, |
3700 | struct genl_info *info, | ||
3695 | struct cfg80211_crypto_settings *settings, | 3701 | struct cfg80211_crypto_settings *settings, |
3696 | int cipher_limit) | 3702 | int cipher_limit) |
3697 | { | 3703 | { |
@@ -3699,6 +3705,19 @@ static int nl80211_crypto_settings(struct genl_info *info, | |||
3699 | 3705 | ||
3700 | settings->control_port = info->attrs[NL80211_ATTR_CONTROL_PORT]; | 3706 | settings->control_port = info->attrs[NL80211_ATTR_CONTROL_PORT]; |
3701 | 3707 | ||
3708 | if (info->attrs[NL80211_ATTR_CONTROL_PORT_ETHERTYPE]) { | ||
3709 | u16 proto; | ||
3710 | proto = nla_get_u16( | ||
3711 | info->attrs[NL80211_ATTR_CONTROL_PORT_ETHERTYPE]); | ||
3712 | settings->control_port_ethertype = cpu_to_be16(proto); | ||
3713 | if (!(rdev->wiphy.flags & WIPHY_FLAG_CONTROL_PORT_PROTOCOL) && | ||
3714 | proto != ETH_P_PAE) | ||
3715 | return -EINVAL; | ||
3716 | if (info->attrs[NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT]) | ||
3717 | settings->control_port_no_encrypt = true; | ||
3718 | } else | ||
3719 | settings->control_port_ethertype = cpu_to_be16(ETH_P_PAE); | ||
3720 | |||
3702 | if (info->attrs[NL80211_ATTR_CIPHER_SUITES_PAIRWISE]) { | 3721 | if (info->attrs[NL80211_ATTR_CIPHER_SUITES_PAIRWISE]) { |
3703 | void *data; | 3722 | void *data; |
3704 | int len, i; | 3723 | int len, i; |
@@ -3826,7 +3845,7 @@ static int nl80211_associate(struct sk_buff *skb, struct genl_info *info) | |||
3826 | if (info->attrs[NL80211_ATTR_PREV_BSSID]) | 3845 | if (info->attrs[NL80211_ATTR_PREV_BSSID]) |
3827 | prev_bssid = nla_data(info->attrs[NL80211_ATTR_PREV_BSSID]); | 3846 | prev_bssid = nla_data(info->attrs[NL80211_ATTR_PREV_BSSID]); |
3828 | 3847 | ||
3829 | err = nl80211_crypto_settings(info, &crypto, 1); | 3848 | err = nl80211_crypto_settings(rdev, info, &crypto, 1); |
3830 | if (!err) | 3849 | if (!err) |
3831 | err = cfg80211_mlme_assoc(rdev, dev, chan, bssid, prev_bssid, | 3850 | err = cfg80211_mlme_assoc(rdev, dev, chan, bssid, prev_bssid, |
3832 | ssid, ssid_len, ie, ie_len, use_mfp, | 3851 | ssid, ssid_len, ie, ie_len, use_mfp, |
@@ -4303,7 +4322,7 @@ static int nl80211_connect(struct sk_buff *skb, struct genl_info *info) | |||
4303 | 4322 | ||
4304 | connect.privacy = info->attrs[NL80211_ATTR_PRIVACY]; | 4323 | connect.privacy = info->attrs[NL80211_ATTR_PRIVACY]; |
4305 | 4324 | ||
4306 | err = nl80211_crypto_settings(info, &connect.crypto, | 4325 | err = nl80211_crypto_settings(rdev, info, &connect.crypto, |
4307 | NL80211_MAX_NR_CIPHER_SUITES); | 4326 | NL80211_MAX_NR_CIPHER_SUITES); |
4308 | if (err) | 4327 | if (err) |
4309 | return err; | 4328 | return err; |