]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
mac80211: fix handling of 4-address-mode in ieee80211_change_iface
authorFelix Fietkau <nbd@openwrt.org>
Mon, 26 Apr 2010 22:26:34 +0000 (00:26 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 5 Jul 2010 18:15:45 +0000 (11:15 -0700)
commit f7917af92024d43bc20bc1afc92de27b0bd0f50b upstream.

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>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
net/mac80211/cfg.c

index 9ae1a4760b58b76ffa991031329b10e23cb51778..e2b43454c7934d37a705a2b518307a165bb362ad 100644 (file)
@@ -98,9 +98,6 @@ 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);
@@ -108,7 +105,9 @@ static int ieee80211_change_iface(struct wiphy *wiphy,
                 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;
 }