350-nl80211_del_beacon_bss.patch 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. --- a/src/drivers/driver_nl80211.c
  2. +++ b/src/drivers/driver_nl80211.c
  3. @@ -2490,13 +2490,18 @@ wpa_driver_nl80211_finish_drv_init(struc
  4. }
  5. -static int wpa_driver_nl80211_del_beacon(struct wpa_driver_nl80211_data *drv)
  6. +static int wpa_driver_nl80211_del_beacon(struct i802_bss *bss)
  7. {
  8. + struct wpa_driver_nl80211_data *drv = bss->drv;
  9. struct nl_msg *msg;
  10. + if (!bss->beacon_set)
  11. + return 0;
  12. +
  13. + bss->beacon_set = 0;
  14. wpa_printf(MSG_DEBUG, "nl80211: Remove beacon (ifindex=%d)",
  15. - drv->ifindex);
  16. - msg = nl80211_drv_msg(drv, 0, NL80211_CMD_DEL_BEACON);
  17. + bss->ifindex);
  18. + msg = nl80211_bss_msg(bss, 0, NL80211_CMD_DEL_BEACON);
  19. return send_and_recv_msgs(drv, msg, NULL, NULL);
  20. }
  21. @@ -2548,7 +2553,7 @@ static void wpa_driver_nl80211_deinit(st
  22. nl80211_remove_monitor_interface(drv);
  23. if (is_ap_interface(drv->nlmode))
  24. - wpa_driver_nl80211_del_beacon(drv);
  25. + wpa_driver_nl80211_del_beacon(bss);
  26. if (drv->eapol_sock >= 0) {
  27. eloop_unregister_read_sock(drv->eapol_sock);
  28. @@ -4703,8 +4708,7 @@ static void nl80211_teardown_ap(struct i
  29. nl80211_remove_monitor_interface(drv);
  30. else
  31. nl80211_mgmt_unsubscribe(bss, "AP teardown");
  32. -
  33. - bss->beacon_set = 0;
  34. + wpa_driver_nl80211_del_beacon(bss);
  35. }
  36. @@ -6728,8 +6732,6 @@ static int wpa_driver_nl80211_if_remove(
  37. } else {
  38. wpa_printf(MSG_DEBUG, "nl80211: First BSS - reassign context");
  39. nl80211_teardown_ap(bss);
  40. - if (!bss->added_if && !drv->first_bss->next)
  41. - wpa_driver_nl80211_del_beacon(drv);
  42. nl80211_destroy_bss(bss);
  43. if (!bss->added_if)
  44. i802_set_iface_flags(bss, 0);
  45. @@ -7091,8 +7093,7 @@ static int wpa_driver_nl80211_deinit_ap(
  46. struct wpa_driver_nl80211_data *drv = bss->drv;
  47. if (!is_ap_interface(drv->nlmode))
  48. return -1;
  49. - wpa_driver_nl80211_del_beacon(drv);
  50. - bss->beacon_set = 0;
  51. + wpa_driver_nl80211_del_beacon(bss);
  52. /*
  53. * If the P2P GO interface was dynamically added, then it is
  54. @@ -7111,8 +7112,7 @@ static int wpa_driver_nl80211_stop_ap(vo
  55. struct wpa_driver_nl80211_data *drv = bss->drv;
  56. if (!is_ap_interface(drv->nlmode))
  57. return -1;
  58. - wpa_driver_nl80211_del_beacon(drv);
  59. - bss->beacon_set = 0;
  60. + wpa_driver_nl80211_del_beacon(bss);
  61. return 0;
  62. }