f493f654f872fad3a11ae060694ab25eb8f87db8
[openwrt.git] / package / kernel / mac80211 / patches / 313-mac80211-drop-4-addr-VLAN-frames-earlier-if-not-conn.patch
1 From: Johannes Berg <johannes.berg@intel.com>
2 Date: Fri, 20 Mar 2015 16:24:22 +0100
3 Subject: [PATCH] mac80211: drop 4-addr VLAN frames earlier if not
4  connected
5
6 If there's no station on the 4-addr VLAN interface, then frames
7 cannot be transmitted. Drop such frames earlier, before setting
8 up all the information for them.
9
10 We should keep the old check though since that code might be used
11 for other internally-generated frames.
12
13 Signed-off-by: Johannes Berg <johannes.berg@intel.com>
14 ---
15
16 --- a/net/mac80211/tx.c
17 +++ b/net/mac80211/tx.c
18 @@ -1921,6 +1921,9 @@ static struct sk_buff *ieee80211_build_h
19                         authorized = test_sta_flag(sta, WLAN_STA_AUTHORIZED);
20                         wme_sta = sta->sta.wme;
21                         have_station = true;
22 +               } else if (sdata->wdev.use_4addr) {
23 +                       ret = -ENOLINK;
24 +                       goto free;
25                 }
26                 ap_sdata = container_of(sdata->bss, struct ieee80211_sub_if_data,
27                                         u.ap);