313-mac80211-drop-4-addr-VLAN-frames-earlier-if-not-conn.patch 873 B

123456789101112131415161718192021222324252627
  1. From: Johannes Berg <[email protected]>
  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. If there's no station on the 4-addr VLAN interface, then frames
  6. cannot be transmitted. Drop such frames earlier, before setting
  7. up all the information for them.
  8. We should keep the old check though since that code might be used
  9. for other internally-generated frames.
  10. Signed-off-by: Johannes Berg <[email protected]>
  11. ---
  12. --- a/net/mac80211/tx.c
  13. +++ b/net/mac80211/tx.c
  14. @@ -1920,6 +1920,9 @@ static struct sk_buff *ieee80211_build_h
  15. authorized = test_sta_flag(sta, WLAN_STA_AUTHORIZED);
  16. wme_sta = sta->sta.wme;
  17. have_station = true;
  18. + } else if (sdata->wdev.use_4addr) {
  19. + ret = -ENOLINK;
  20. + goto free;
  21. }
  22. ap_sdata = container_of(sdata->bss, struct ieee80211_sub_if_data,
  23. u.ap);