diff options
Diffstat (limited to 'net/mac80211/cfg.c')
-rw-r--r-- | net/mac80211/cfg.c | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 7f18c8fa1880..93ee1fd5c08d 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
@@ -42,15 +42,6 @@ static bool nl80211_params_check(enum nl80211_iftype type, | |||
42 | if (!nl80211_type_check(type)) | 42 | if (!nl80211_type_check(type)) |
43 | return false; | 43 | return false; |
44 | 44 | ||
45 | if (params->use_4addr > 0) { | ||
46 | switch(type) { | ||
47 | case NL80211_IFTYPE_AP_VLAN: | ||
48 | case NL80211_IFTYPE_STATION: | ||
49 | break; | ||
50 | default: | ||
51 | return false; | ||
52 | } | ||
53 | } | ||
54 | return true; | 45 | return true; |
55 | } | 46 | } |
56 | 47 | ||
@@ -107,12 +98,16 @@ static int ieee80211_change_iface(struct wiphy *wiphy, | |||
107 | params->mesh_id_len, | 98 | params->mesh_id_len, |
108 | params->mesh_id); | 99 | params->mesh_id); |
109 | 100 | ||
110 | if (params->use_4addr >= 0) | ||
111 | sdata->use_4addr = !!params->use_4addr; | ||
112 | |||
113 | if (sdata->vif.type != NL80211_IFTYPE_MONITOR || !flags) | 101 | if (sdata->vif.type != NL80211_IFTYPE_MONITOR || !flags) |
114 | return 0; | 102 | return 0; |
115 | 103 | ||
104 | if (type == NL80211_IFTYPE_AP_VLAN && | ||
105 | params && params->use_4addr == 0) | ||
106 | rcu_assign_pointer(sdata->u.vlan.sta, NULL); | ||
107 | else if (type == NL80211_IFTYPE_STATION && | ||
108 | params && params->use_4addr >= 0) | ||
109 | sdata->u.mgd.use_4addr = params->use_4addr; | ||
110 | |||
116 | sdata->u.mntr_flags = *flags; | 111 | sdata->u.mntr_flags = *flags; |
117 | return 0; | 112 | return 0; |
118 | } | 113 | } |
@@ -398,13 +393,13 @@ static void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo) | |||
398 | static int ieee80211_dump_station(struct wiphy *wiphy, struct net_device *dev, | 393 | static int ieee80211_dump_station(struct wiphy *wiphy, struct net_device *dev, |
399 | int idx, u8 *mac, struct station_info *sinfo) | 394 | int idx, u8 *mac, struct station_info *sinfo) |
400 | { | 395 | { |
401 | struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); | 396 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
402 | struct sta_info *sta; | 397 | struct sta_info *sta; |
403 | int ret = -ENOENT; | 398 | int ret = -ENOENT; |
404 | 399 | ||
405 | rcu_read_lock(); | 400 | rcu_read_lock(); |
406 | 401 | ||
407 | sta = sta_info_get_by_idx(local, idx, dev); | 402 | sta = sta_info_get_by_idx(sdata, idx); |
408 | if (sta) { | 403 | if (sta) { |
409 | ret = 0; | 404 | ret = 0; |
410 | memcpy(mac, sta->sta.addr, ETH_ALEN); | 405 | memcpy(mac, sta->sta.addr, ETH_ALEN); |
@@ -827,9 +822,11 @@ static int ieee80211_change_station(struct wiphy *wiphy, | |||
827 | return -EINVAL; | 822 | return -EINVAL; |
828 | } | 823 | } |
829 | 824 | ||
830 | if (vlansdata->use_4addr) { | 825 | if (params->vlan->ieee80211_ptr->use_4addr) { |
831 | if (vlansdata->u.vlan.sta) | 826 | if (vlansdata->u.vlan.sta) { |
827 | rcu_read_unlock(); | ||
832 | return -EBUSY; | 828 | return -EBUSY; |
829 | } | ||
833 | 830 | ||
834 | rcu_assign_pointer(vlansdata->u.vlan.sta, sta); | 831 | rcu_assign_pointer(vlansdata->u.vlan.sta, sta); |
835 | } | 832 | } |