aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorThadeu Lima de Souza Cascardo <cascardo@holoscopio.com>2010-02-12 09:34:50 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-02-15 16:12:52 -0500
commit0e956c132f822d414a4ce84726ac1d1294364581 (patch)
treef5c0d031606d3aa4abb6ac2468ce5263d1e17993 /net
parent2f5265e6e785b2a666dd985ea157bc8c260be8fa (diff)
nl80211: does not allow NEW_STATION and DEL_STATION for mesh
As discussed in linux-wireless mailing list, adding and removing stations for mesh topologies is not necessary. Since doing it triggers bugs, the sugestion was to simply disable it. Tested using a custom iw command "station new". Works only after using hostapd. "station del" command also works. Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com> Cc: Johannes Berg <johannes@sipsolutions.net> Cc: Simon Raffeiner <sturmflut@lieberbiber.de> Cc: Andrey Yurovsky <andrey@cozybit.com> Cc: Javier Cardona <javier@cozybit.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r--net/wireless/nl80211.c49
1 files changed, 13 insertions, 36 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 5b79ecf17bea..a95ab9e4c19e 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -2010,6 +2010,9 @@ static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info)
2010 if (!info->attrs[NL80211_ATTR_STA_SUPPORTED_RATES]) 2010 if (!info->attrs[NL80211_ATTR_STA_SUPPORTED_RATES])
2011 return -EINVAL; 2011 return -EINVAL;
2012 2012
2013 if (!info->attrs[NL80211_ATTR_STA_AID])
2014 return -EINVAL;
2015
2013 mac_addr = nla_data(info->attrs[NL80211_ATTR_MAC]); 2016 mac_addr = nla_data(info->attrs[NL80211_ATTR_MAC]);
2014 params.supported_rates = 2017 params.supported_rates =
2015 nla_data(info->attrs[NL80211_ATTR_STA_SUPPORTED_RATES]); 2018 nla_data(info->attrs[NL80211_ATTR_STA_SUPPORTED_RATES]);
@@ -2018,11 +2021,9 @@ static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info)
2018 params.listen_interval = 2021 params.listen_interval =
2019 nla_get_u16(info->attrs[NL80211_ATTR_STA_LISTEN_INTERVAL]); 2022 nla_get_u16(info->attrs[NL80211_ATTR_STA_LISTEN_INTERVAL]);
2020 2023
2021 if (info->attrs[NL80211_ATTR_STA_AID]) { 2024 params.aid = nla_get_u16(info->attrs[NL80211_ATTR_STA_AID]);
2022 params.aid = nla_get_u16(info->attrs[NL80211_ATTR_STA_AID]); 2025 if (!params.aid || params.aid > IEEE80211_MAX_AID)
2023 if (!params.aid || params.aid > IEEE80211_MAX_AID) 2026 return -EINVAL;
2024 return -EINVAL;
2025 }
2026 2027
2027 if (info->attrs[NL80211_ATTR_HT_CAPABILITY]) 2028 if (info->attrs[NL80211_ATTR_HT_CAPABILITY])
2028 params.ht_capa = 2029 params.ht_capa =
@@ -2037,6 +2038,12 @@ static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info)
2037 if (err) 2038 if (err)
2038 goto out_rtnl; 2039 goto out_rtnl;
2039 2040
2041 if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP &&
2042 dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP_VLAN) {
2043 err = -EINVAL;
2044 goto out;
2045 }
2046
2040 err = get_vlan(info, rdev, &params.vlan); 2047 err = get_vlan(info, rdev, &params.vlan);
2041 if (err) 2048 if (err)
2042 goto out; 2049 goto out;
@@ -2044,35 +2051,6 @@ static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info)
2044 /* validate settings */ 2051 /* validate settings */
2045 err = 0; 2052 err = 0;
2046 2053
2047 switch (dev->ieee80211_ptr->iftype) {
2048 case NL80211_IFTYPE_AP:
2049 case NL80211_IFTYPE_AP_VLAN:
2050 /* all ok but must have AID */
2051 if (!params.aid)
2052 err = -EINVAL;
2053 break;
2054 case NL80211_IFTYPE_MESH_POINT:
2055 /* disallow things mesh doesn't support */
2056 if (params.vlan)
2057 err = -EINVAL;
2058 if (params.aid)
2059 err = -EINVAL;
2060 if (params.ht_capa)
2061 err = -EINVAL;
2062 if (params.listen_interval >= 0)
2063 err = -EINVAL;
2064 if (params.supported_rates)
2065 err = -EINVAL;
2066 if (params.sta_flags_mask)
2067 err = -EINVAL;
2068 break;
2069 default:
2070 err = -EINVAL;
2071 }
2072
2073 if (err)
2074 goto out;
2075
2076 if (!rdev->ops->add_station) { 2054 if (!rdev->ops->add_station) {
2077 err = -EOPNOTSUPP; 2055 err = -EOPNOTSUPP;
2078 goto out; 2056 goto out;
@@ -2113,8 +2091,7 @@ static int nl80211_del_station(struct sk_buff *skb, struct genl_info *info)
2113 goto out_rtnl; 2091 goto out_rtnl;
2114 2092
2115 if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP && 2093 if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP &&
2116 dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP_VLAN && 2094 dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP_VLAN) {
2117 dev->ieee80211_ptr->iftype != NL80211_IFTYPE_MESH_POINT) {
2118 err = -EINVAL; 2095 err = -EINVAL;
2119 goto out; 2096 goto out;
2120 } 2097 }