130-Revert-nl80211-Remove-duplicated-check-in-nl80211_se.patch 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. From 23dc11dfbd8e78a2450120e9afc83c1d32a8e683 Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <[email protected]>
  3. Date: Mon, 12 Sep 2016 19:02:34 +0200
  4. Subject: [PATCH] Revert "nl80211: Remove duplicated check in
  5. nl80211_setup_ap()"
  6. MIME-Version: 1.0
  7. Content-Type: text/plain; charset=UTF-8
  8. Content-Transfer-Encoding: 8bit
  9. This reverts commit 647862eb60c324015ea31293cc052558b5185ca4.
  10. The second check of device_ap_sme looks like duplicated, but it isn't
  11. actually. The trick is nl80211_create_monitor_interface may change that
  12. variable value and the second evaluation may give a different result.
  13. This definitely isn't a very clear code, but that change caused a
  14. regression for drivers that:
  15. 1) Don't report NL80211_ATTR_DEVICE_AP_SME
  16. 2) Don't support monitor mode
  17. 3) Don't support subscribing for PROBE_REQ and/or ACTION frames
  18. like brcmfmac. With such drivers hostapd doesn't start anymore.
  19. Signed-off-by: Rafał Miłecki <[email protected]>
  20. ---
  21. src/drivers/driver_nl80211.c | 3 ++-
  22. 1 file changed, 2 insertions(+), 1 deletion(-)
  23. --- a/src/drivers/driver_nl80211.c
  24. +++ b/src/drivers/driver_nl80211.c
  25. @@ -4434,7 +4434,8 @@ static int nl80211_setup_ap(struct i802_
  26. "nl80211: Failed to subscribe for mgmt frames from SME driver - trying to run without it");
  27. if (!drv->device_ap_sme && drv->use_monitor &&
  28. - nl80211_create_monitor_interface(drv))
  29. + nl80211_create_monitor_interface(drv) &&
  30. + !drv->device_ap_sme)
  31. return -1;
  32. if (drv->device_ap_sme &&