From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from nbd.name ([88.198.39.176]:54004 "EHLO ds10.nbd.name" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751422Ab0DZRy3 (ORCPT ); Mon, 26 Apr 2010 13:54:29 -0400 Message-ID: <4BD5D34F.8080205@openwrt.org> Date: Mon, 26 Apr 2010 19:54:23 +0200 From: Felix Fietkau MIME-Version: 1.0 To: linux-wireless CC: "John W. Linville" , Johannes Berg Subject: [PATCH] mac80211: fix handling of 4-address-mode in ieee80211_change_iface Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-wireless-owner@vger.kernel.org List-ID: 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 Cc: stable@kernel.org --- --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -97,9 +97,6 @@ static int ieee80211_change_iface(struct 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); @@ -107,6 +104,9 @@ static int ieee80211_change_iface(struct params && params->use_4addr >= 0) sdata->u.mgd.use_4addr = params->use_4addr; + if (sdata->vif.type != NL80211_IFTYPE_MONITOR || !flags) + return 0; + sdata->u.mntr_flags = *flags; return 0; }