summaryrefslogtreecommitdiff
path: root/package/hostapd/patches/451-nl80211_del_beacon_bss.patch
blob: b23acc6f019a7b91be66811dd664acde2c33fb0b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -1604,23 +1604,41 @@ wpa_driver_nl80211_finish_drv_init(struc
 }
 
 
-static int wpa_driver_nl80211_del_beacon(struct wpa_driver_nl80211_data *drv)
+static int wpa_driver_nl80211_del_bss_beacon(struct i802_bss *bss)
 {
+	struct wpa_driver_nl80211_data *drv = bss->drv;
 	struct nl_msg *msg;
 
+	bss->beacon_set = 0;
+
 	msg = nlmsg_alloc();
 	if (!msg)
 		return -ENOMEM;
 
 	genlmsg_put(msg, 0, 0, genl_family_get_id(drv->nl80211), 0,
 		    0, NL80211_CMD_DEL_BEACON, 0);
-	NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, drv->ifindex);
+	NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, bss->ifindex);
 
 	return send_and_recv_msgs(drv, msg, NULL, NULL);
  nla_put_failure:
+	nlmsg_free(msg);
 	return -ENOBUFS;
 }
 
+static int wpa_driver_nl80211_del_beacon(struct wpa_driver_nl80211_data *drv)
+{
+	struct i802_bss *bss;
+
+	for (bss = &drv->first_bss; bss; bss = bss->next)
+		wpa_driver_nl80211_del_bss_beacon(bss);
+}
+
+static int wpa_driver_nl80211_stop_ap(void *priv)
+{
+	struct i802_bss *bss = priv;
+
+	wpa_driver_nl80211_del_beacon(bss->drv);
+}
 
 /**
  * wpa_driver_nl80211_deinit - Deinitialize nl80211 driver interface
@@ -5512,4 +5530,5 @@ const struct wpa_driver_ops wpa_driver_n
 	.send_ft_action = nl80211_send_ft_action,
 	.signal_monitor = nl80211_signal_monitor,
 	.send_frame = nl80211_send_frame,
+	.stop_ap = wpa_driver_nl80211_stop_ap,
 };
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -1774,6 +1774,8 @@ struct wpa_driver_ops {
 	 */
 	int (*send_frame)(void *priv, const u8 *data, size_t data_len,
 			  int encrypt);
+
+	int (*stop_ap)(void *priv);
 };