summaryrefslogtreecommitdiff
path: root/package/kernel/mac80211/patches/313-mac80211-drop-4-addr-VLAN-frames-earlier-if-not-conn.patch
blob: 41253519b3ff6b65e1d072f5ec061e9a978759a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
From: Johannes Berg <johannes.berg@intel.com>
Date: Fri, 20 Mar 2015 16:24:22 +0100
Subject: [PATCH] mac80211: drop 4-addr VLAN frames earlier if not
 connected

If there's no station on the 4-addr VLAN interface, then frames
cannot be transmitted. Drop such frames earlier, before setting
up all the information for them.

We should keep the old check though since that code might be used
for other internally-generated frames.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---

--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1920,6 +1920,9 @@ static struct sk_buff *ieee80211_build_h
 			authorized = test_sta_flag(sta, WLAN_STA_AUTHORIZED);
 			wme_sta = sta->sta.wme;
 			have_station = true;
+		} else if (sdata->wdev.use_4addr) {
+			ret = -ENOLINK;
+			goto free;
 		}
 		ap_sdata = container_of(sdata->bss, struct ieee80211_sub_if_data,
 					u.ap);