hostapd: update to version 2018-12-02 (2.7)
[openwrt/openwrt.git] / package / network / services / hostapd / patches / 350-nl80211_del_beacon_bss.patch
1 --- a/src/drivers/driver_nl80211.c
2 +++ b/src/drivers/driver_nl80211.c
3 @@ -2634,10 +2634,15 @@ static int wpa_driver_nl80211_del_beacon
4 struct nl_msg *msg;
5 struct wpa_driver_nl80211_data *drv = bss->drv;
6
7 + if (!bss->beacon_set)
8 + return 0;
9 +
10 + bss->beacon_set = 0;
11 +
12 wpa_printf(MSG_DEBUG, "nl80211: Remove beacon (ifindex=%d)",
13 - drv->ifindex);
14 + bss->ifindex);
15 nl80211_put_wiphy_data_ap(bss);
16 - msg = nl80211_drv_msg(drv, 0, NL80211_CMD_DEL_BEACON);
17 + msg = nl80211_bss_msg(bss, 0, NL80211_CMD_DEL_BEACON);
18 return send_and_recv_msgs(drv, msg, NULL, NULL);
19 }
20
21 @@ -4919,7 +4924,7 @@ static void nl80211_teardown_ap(struct i
22 nl80211_mgmt_unsubscribe(bss, "AP teardown");
23
24 nl80211_put_wiphy_data_ap(bss);
25 - bss->beacon_set = 0;
26 + wpa_driver_nl80211_del_beacon(bss);
27 }
28
29
30 @@ -7160,8 +7165,6 @@ static int wpa_driver_nl80211_if_remove(
31 } else {
32 wpa_printf(MSG_DEBUG, "nl80211: First BSS - reassign context");
33 nl80211_teardown_ap(bss);
34 - if (!bss->added_if && !drv->first_bss->next)
35 - wpa_driver_nl80211_del_beacon(bss);
36 nl80211_destroy_bss(bss);
37 if (!bss->added_if)
38 i802_set_iface_flags(bss, 0);
39 @@ -7540,7 +7543,6 @@ static int wpa_driver_nl80211_deinit_ap(
40 if (!is_ap_interface(drv->nlmode))
41 return -1;
42 wpa_driver_nl80211_del_beacon(bss);
43 - bss->beacon_set = 0;
44
45 /*
46 * If the P2P GO interface was dynamically added, then it is
47 @@ -7560,7 +7562,6 @@ static int wpa_driver_nl80211_stop_ap(vo
48 if (!is_ap_interface(drv->nlmode))
49 return -1;
50 wpa_driver_nl80211_del_beacon(bss);
51 - bss->beacon_set = 0;
52 return 0;
53 }
54