0e33f0afaad99d344cfcec63d87a3158b3216ace
[openwrt/svn-archive/archive.git] / package / network / services / hostapd / patches / 451-nl80211_del_beacon_bss.patch
1 --- a/src/drivers/driver_nl80211.c
2 +++ b/src/drivers/driver_nl80211.c
3 @@ -4115,16 +4115,18 @@ wpa_driver_nl80211_finish_drv_init(struc
4 }
5
6
7 -static int wpa_driver_nl80211_del_beacon(struct wpa_driver_nl80211_data *drv)
8 +static int wpa_driver_nl80211_del_bss_beacon(struct i802_bss *bss)
9 {
10 + struct wpa_driver_nl80211_data *drv = bss->drv;
11 struct nl_msg *msg;
12
13 + bss->beacon_set = 0;
14 msg = nlmsg_alloc();
15 if (!msg)
16 return -ENOMEM;
17
18 nl80211_cmd(drv, msg, 0, NL80211_CMD_DEL_BEACON);
19 - NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, drv->ifindex);
20 + NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, bss->ifindex);
21
22 return send_and_recv_msgs(drv, msg, NULL, NULL);
23 nla_put_failure:
24 @@ -4132,6 +4134,15 @@ static int wpa_driver_nl80211_del_beacon
25 return -ENOBUFS;
26 }
27
28 +static int wpa_driver_nl80211_del_beacon(struct wpa_driver_nl80211_data *drv)
29 +{
30 + struct i802_bss *bss;
31 +
32 + for (bss = &drv->first_bss; bss; bss = bss->next)
33 + wpa_driver_nl80211_del_bss_beacon(bss);
34 +
35 + return 0;
36 +}
37
38 /**
39 * wpa_driver_nl80211_deinit - Deinitialize nl80211 driver interface
40 @@ -9575,7 +9586,6 @@ static int wpa_driver_nl80211_stop_ap(vo
41 if (!is_ap_interface(drv->nlmode))
42 return -1;
43 wpa_driver_nl80211_del_beacon(drv);
44 - bss->beacon_set = 0;
45 return 0;
46 }
47