Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 351772
b: refs/heads/master
c: ba23d20
h: refs/heads/master
v: v3
  • Loading branch information
Johannes Berg committed Jan 3, 2013
1 parent 104182d commit 59f98b1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 21add825f90a50407e0121833c8b7cd2c071c478
refs/heads/master: ba23d2068d85f6616ea5f92320c04e87d4b9e141
9 changes: 5 additions & 4 deletions trunk/net/mac80211/cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1208,10 +1208,11 @@ static int sta_apply_parameters(struct ieee80211_local *local,
sta->sta.aid = params->aid;

/*
* FIXME: updating the following information is racy when this
* function is called from ieee80211_change_station().
* However, all this information should be static so
* maybe we should just reject attemps to change it.
* Some of the following updates would be racy if called on an
* existing station, via ieee80211_change_station(). However,
* all such changes are rejected by cfg80211 except for updates
* changing the supported rates on an existing but not yet used
* TDLS peer.
*/

if (params->listen_interval >= 0)
Expand Down
22 changes: 8 additions & 14 deletions trunk/net/wireless/nl80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -3188,13 +3188,9 @@ static int nl80211_set_station(struct sk_buff *skb, struct genl_info *info)
nla_len(info->attrs[NL80211_ATTR_STA_SUPPORTED_RATES]);
}

if (info->attrs[NL80211_ATTR_STA_LISTEN_INTERVAL])
params.listen_interval =
nla_get_u16(info->attrs[NL80211_ATTR_STA_LISTEN_INTERVAL]);

if (info->attrs[NL80211_ATTR_HT_CAPABILITY])
params.ht_capa =
nla_data(info->attrs[NL80211_ATTR_HT_CAPABILITY]);
if (info->attrs[NL80211_ATTR_STA_LISTEN_INTERVAL] ||
info->attrs[NL80211_ATTR_HT_CAPABILITY])
return -EINVAL;

if (!rdev->ops->change_station)
return -EOPNOTSUPP;
Expand Down Expand Up @@ -3246,6 +3242,10 @@ static int nl80211_set_station(struct sk_buff *skb, struct genl_info *info)
BIT(NL80211_STA_FLAG_ASSOCIATED)))
return -EINVAL;

/* reject other things that can't change */
if (params.supported_rates)
return -EINVAL;

/* must be last in here for error handling */
params.vlan = get_vlan(info, rdev);
if (IS_ERR(params.vlan))
Expand All @@ -3265,10 +3265,6 @@ static int nl80211_set_station(struct sk_buff *skb, struct genl_info *info)
/* disallow things sta doesn't support */
if (params.plink_action)
return -EINVAL;
if (params.ht_capa)
return -EINVAL;
if (params.listen_interval >= 0)
return -EINVAL;
/* reject any changes other than AUTHORIZED */
if (params.sta_flags_mask & ~BIT(NL80211_STA_FLAG_AUTHORIZED))
return -EINVAL;
Expand All @@ -3277,9 +3273,7 @@ static int nl80211_set_station(struct sk_buff *skb, struct genl_info *info)
/* disallow things mesh doesn't support */
if (params.vlan)
return -EINVAL;
if (params.ht_capa)
return -EINVAL;
if (params.listen_interval >= 0)
if (params.supported_rates)
return -EINVAL;
/*
* No special handling for TDLS here -- the userspace
Expand Down

0 comments on commit 59f98b1

Please sign in to comment.