Skip to content

Commit

Permalink
mac80211: fix handling of 4-address-mode in ieee80211_change_iface
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Felix Fietkau authored and John W. Linville committed Apr 27, 2010
1 parent 4f82471 commit f7917af
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions net/mac80211/cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,16 @@ static int ieee80211_change_iface(struct wiphy *wiphy,
params->mesh_id_len,
params->mesh_id);

if (sdata->vif.type != NL80211_IFTYPE_MONITOR || !flags)
return 0;

if (type == NL80211_IFTYPE_AP_VLAN &&
params && params->use_4addr == 0)
rcu_assign_pointer(sdata->u.vlan.sta, NULL);
else if (type == NL80211_IFTYPE_STATION &&
params && params->use_4addr >= 0)
sdata->u.mgd.use_4addr = params->use_4addr;

sdata->u.mntr_flags = *flags;
if (sdata->vif.type == NL80211_IFTYPE_MONITOR && flags)
sdata->u.mntr_flags = *flags;

return 0;
}

Expand Down

0 comments on commit f7917af

Please sign in to comment.