]> git.hungrycats.org Git - linux/commitdiff
mac80211: do not transmit frames on unconfigured 4-addr vlan interfaces
authorFelix Fietkau <nbd@openwrt.org>
Fri, 8 Jan 2010 17:15:13 +0000 (18:15 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 15 Mar 2010 16:06:43 +0000 (09:06 -0700)
commit 3f0e0b220f80075ce15483b20458192c0ac27426 upstream.

If frames are transmitted on 4-addr ap vlan interfaces with no station,
they end up being transmitted unencrypted, even if the ap interface
uses WPA. This patch add some sanity checking to make sure that this
does not happen.

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/tx.c

index ac210b58670223bdee80d46b8a9792a2a9115d80..70c79c3013fa3e99750656461fde9ba82de4dbb8 100644 (file)
@@ -1052,8 +1052,11 @@ ieee80211_tx_prepare(struct ieee80211_sub_if_data *sdata,
 
        hdr = (struct ieee80211_hdr *) skb->data;
 
-       if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
+       if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) {
                tx->sta = rcu_dereference(sdata->u.vlan.sta);
+               if (!tx->sta && sdata->dev->ieee80211_ptr->use_4addr)
+                       return TX_DROP;
+       }
        if (!tx->sta)
                tx->sta = sta_info_get(local, hdr->addr1);