summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2015-03-20 18:01:52 +0300
committerJohannes Berg <johannes.berg@intel.com>2015-03-20 18:27:36 +0300
commite33f5569aafadfa68aea32457a9246818d3dfe48 (patch)
treef6f1c3c220af922320ece867a35ec4a0d69c814c /net
parenta8d15ff0050aef96a14a185b5138f01f98109b40 (diff)
downloadlinux-e33f5569aafadfa68aea32457a9246818d3dfe48.tar.xz
mac80211: mesh: avoid pointless station lookup
In ieee80211_build_hdr(), the station is looked up to build the header correctly (QoS field) and to check for authorization. For mesh, authorization isn't checked here, and QoS capability is mandatory, so the station lookup can be avoided. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/tx.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 1d6344679bf1..5af35ef35322 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -2052,12 +2052,14 @@ static struct sk_buff *ieee80211_build_hdr(struct ieee80211_sub_if_data *sdata,
}
/*
- * There's no need to try to look up the destination
- * if it is a multicast address (which can only happen
- * in AP mode)
+ * There's no need to try to look up the destination station
+ * if it is a multicast address. In mesh, there's no need to
+ * look up the station at all as it always must be QoS capable
+ * and mesh mode checks authorization later.
*/
multicast = is_multicast_ether_addr(hdr.addr1);
- if (!multicast && !have_station) {
+ if (!multicast && !have_station &&
+ !ieee80211_vif_is_mesh(&sdata->vif)) {
sta = sta_info_get(sdata, hdr.addr1);
if (sta) {
authorized = test_sta_flag(sta, WLAN_STA_AUTHORIZED);