diff options
author | Felix Fietkau <nbd@openwrt.org> | 2010-04-26 18:26:34 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-04-27 16:09:16 -0400 |
commit | f7917af92024d43bc20bc1afc92de27b0bd0f50b (patch) | |
tree | 3b88db453d8297cf44694c176ef7129234573bb9 /net/mac80211 | |
parent | 4f824719a2729f1a6bb78de20c4d3b3dbdd81a09 (diff) |
mac80211: fix handling of 4-address-mode in ieee80211_change_iface
A misplaced interface type check bails out too early if the interface
is not in monitor mode. This patch moves it to the right place, so that
it only covers changes to the monitor flags.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Cc: stable@kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r-- | net/mac80211/cfg.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index f97dda735cbb..592f07d2ae5c 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
@@ -96,9 +96,6 @@ static int ieee80211_change_iface(struct wiphy *wiphy, | |||
96 | params->mesh_id_len, | 96 | params->mesh_id_len, |
97 | params->mesh_id); | 97 | params->mesh_id); |
98 | 98 | ||
99 | if (sdata->vif.type != NL80211_IFTYPE_MONITOR || !flags) | ||
100 | return 0; | ||
101 | |||
102 | if (type == NL80211_IFTYPE_AP_VLAN && | 99 | if (type == NL80211_IFTYPE_AP_VLAN && |
103 | params && params->use_4addr == 0) | 100 | params && params->use_4addr == 0) |
104 | rcu_assign_pointer(sdata->u.vlan.sta, NULL); | 101 | rcu_assign_pointer(sdata->u.vlan.sta, NULL); |
@@ -106,7 +103,9 @@ static int ieee80211_change_iface(struct wiphy *wiphy, | |||
106 | params && params->use_4addr >= 0) | 103 | params && params->use_4addr >= 0) |
107 | sdata->u.mgd.use_4addr = params->use_4addr; | 104 | sdata->u.mgd.use_4addr = params->use_4addr; |
108 | 105 | ||
109 | sdata->u.mntr_flags = *flags; | 106 | if (sdata->vif.type == NL80211_IFTYPE_MONITOR && flags) |
107 | sdata->u.mntr_flags = *flags; | ||
108 | |||
110 | return 0; | 109 | return 0; |
111 | } | 110 | } |
112 | 111 | ||