add chaos_calmer branch
[15.05/openwrt.git] / package / kernel / mac80211 / patches / 314-mac80211-mesh-avoid-pointless-station-lookup.patch
1 From: Johannes Berg <johannes.berg@intel.com>
2 Date: Fri, 20 Mar 2015 16:24:23 +0100
3 Subject: [PATCH] mac80211: mesh: avoid pointless station lookup
4
5 In ieee80211_build_hdr(), the station is looked up to build the
6 header correctly (QoS field) and to check for authorization. For
7 mesh, authorization isn't checked here, and QoS capability is
8 mandatory, so the station lookup can be avoided.
9
10 Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 ---
12
13 --- a/net/mac80211/tx.c
14 +++ b/net/mac80211/tx.c
15 @@ -2130,12 +2130,14 @@ static struct sk_buff *ieee80211_build_h
16         }
17  
18         /*
19 -        * There's no need to try to look up the destination
20 -        * if it is a multicast address (which can only happen
21 -        * in AP mode)
22 +        * There's no need to try to look up the destination station
23 +        * if it is a multicast address. In mesh, there's no need to
24 +        * look up the station at all as it always must be QoS capable
25 +        * and mesh mode checks authorization later.
26          */
27         multicast = is_multicast_ether_addr(hdr.addr1);
28 -       if (!multicast && !have_station) {
29 +       if (!multicast && !have_station &&
30 +           !ieee80211_vif_is_mesh(&sdata->vif)) {
31                 sta = sta_info_get(sdata, hdr.addr1);
32                 if (sta) {
33                         authorized = test_sta_flag(sta, WLAN_STA_AUTHORIZED);