015-mesh-do-not-use-offchan-mgmt-tx-on-DFS.patch 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. From 9423e8be0393e82c8622806a0529e47fd5583c0b Mon Sep 17 00:00:00 2001
  2. From: Peter Oh <[email protected]>
  3. Date: Tue, 29 May 2018 14:39:19 -0700
  4. Subject: [PATCH 15/18] mesh: do not use offchan mgmt tx on DFS
  5. Drivers don't allow mesh to use offchannel on management Tx.
  6. Signed-off-by: Peter Oh <[email protected]>
  7. Signed-off-by: Daniel Golle <[email protected]>
  8. [[email protected]: adapted to changed ieee80211_is_dfs prototype]
  9. ---
  10. src/drivers/driver_nl80211.c | 12 ++++++++++--
  11. 1 file changed, 10 insertions(+), 2 deletions(-)
  12. --- a/src/drivers/driver_nl80211.c
  13. +++ b/src/drivers/driver_nl80211.c
  14. @@ -7268,6 +7268,10 @@ static int wpa_driver_nl80211_send_actio
  15. struct wpa_driver_nl80211_data *drv = bss->drv;
  16. int ret = -1;
  17. u8 *buf;
  18. + int offchanok = 1;
  19. + u16 num_modes, flags;
  20. + struct hostapd_hw_modes *modes;
  21. + u8 dfs_domain;
  22. struct ieee80211_hdr *hdr;
  23. wpa_printf(MSG_DEBUG, "nl80211: Send Action frame (ifindex=%d, "
  24. @@ -7292,7 +7296,11 @@ static int wpa_driver_nl80211_send_actio
  25. } else {
  26. os_memset(bss->rand_addr, 0, ETH_ALEN);
  27. }
  28. -
  29. + if (is_mesh_interface(drv->nlmode) &&
  30. + (modes = nl80211_get_hw_feature_data(bss, &num_modes, &flags,
  31. + &dfs_domain)) &&
  32. + ieee80211_is_dfs(freq, modes, num_modes))
  33. + offchanok = 0;
  34. if (is_ap_interface(drv->nlmode) &&
  35. (!(drv->capa.flags & WPA_DRIVER_FLAGS_OFFCHANNEL_TX) ||
  36. (int) freq == bss->freq || drv->device_ap_sme ||
  37. @@ -7304,7 +7312,7 @@ static int wpa_driver_nl80211_send_actio
  38. ret = nl80211_send_frame_cmd(bss, freq, wait_time, buf,
  39. 24 + data_len,
  40. &drv->send_action_cookie,
  41. - no_cck, 0, 1, NULL, 0);
  42. + no_cck, 0, offchanok, NULL, 0);
  43. os_free(buf);
  44. return ret;