314-mac80211-mesh-avoid-pointless-station-lookup.patch 1.2 KB

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