7c6c5e38144215655018704d832c475a83a8208d
[openwrt/openwrt.git] / package / network / services / hostapd / patches / 600-ubus_support.patch
1 --- a/hostapd/Makefile
2 +++ b/hostapd/Makefile
3 @@ -166,6 +166,11 @@ OBJS += ../src/common/hw_features_common
4
5 OBJS += ../src/eapol_auth/eapol_auth_sm.o
6
7 +ifdef CONFIG_UBUS
8 +CFLAGS += -DUBUS_SUPPORT
9 +OBJS += ../src/ap/ubus.o
10 +LIBS += -lubox -lubus
11 +endif
12
13 ifdef CONFIG_CODE_COVERAGE
14 CFLAGS += -O0 -fprofile-arcs -ftest-coverage
15 --- a/src/ap/hostapd.h
16 +++ b/src/ap/hostapd.h
17 @@ -18,6 +18,7 @@
18 #include "utils/list.h"
19 #include "ap_config.h"
20 #include "drivers/driver.h"
21 +#include "ubus.h"
22
23 #define OCE_STA_CFON_ENABLED(hapd) \
24 ((hapd->conf->oce & OCE_STA_CFON) && \
25 @@ -92,7 +93,7 @@ struct hapd_interfaces {
26 #ifdef CONFIG_CTRL_IFACE_UDP
27 unsigned char ctrl_iface_cookie[CTRL_IFACE_COOKIE_LEN];
28 #endif /* CONFIG_CTRL_IFACE_UDP */
29 -
30 + struct ubus_object ubus;
31 };
32
33 enum hostapd_chan_status {
34 @@ -183,6 +184,7 @@ struct hostapd_data {
35 struct hostapd_iface *iface;
36 struct hostapd_config *iconf;
37 struct hostapd_bss_config *conf;
38 + struct hostapd_ubus_bss ubus;
39 int interface_added; /* virtual interface added for this BSS */
40 unsigned int started:1;
41 unsigned int disabled:1;
42 @@ -673,6 +675,7 @@ hostapd_alloc_bss_data(struct hostapd_if
43 struct hostapd_bss_config *bss);
44 int hostapd_setup_interface(struct hostapd_iface *iface);
45 int hostapd_setup_interface_complete(struct hostapd_iface *iface, int err);
46 +void hostapd_set_own_neighbor_report(struct hostapd_data *hapd);
47 void hostapd_interface_deinit(struct hostapd_iface *iface);
48 void hostapd_interface_free(struct hostapd_iface *iface);
49 struct hostapd_iface * hostapd_alloc_iface(void);
50 --- a/src/ap/hostapd.c
51 +++ b/src/ap/hostapd.c
52 @@ -401,6 +401,7 @@ void hostapd_free_hapd_data(struct hosta
53 hapd->beacon_set_done = 0;
54
55 wpa_printf(MSG_DEBUG, "%s(%s)", __func__, hapd->conf->iface);
56 + hostapd_ubus_free_bss(hapd);
57 accounting_deinit(hapd);
58 hostapd_deinit_wpa(hapd);
59 vlan_deinit(hapd);
60 @@ -1431,6 +1432,8 @@ static int hostapd_setup_bss(struct host
61 if (hapd->driver && hapd->driver->set_operstate)
62 hapd->driver->set_operstate(hapd->drv_priv, 1);
63
64 + hostapd_ubus_add_bss(hapd);
65 +
66 return 0;
67 }
68
69 @@ -2050,6 +2053,7 @@ static int hostapd_setup_interface_compl
70 if (err)
71 goto fail;
72
73 + hostapd_ubus_add_iface(iface);
74 wpa_printf(MSG_DEBUG, "Completing interface initialization");
75 if (iface->freq) {
76 #ifdef NEED_AP_MLME
77 @@ -2248,6 +2252,7 @@ dfs_offload:
78
79 fail:
80 wpa_printf(MSG_ERROR, "Interface initialization failed");
81 + hostapd_ubus_free_iface(iface);
82 hostapd_set_state(iface, HAPD_IFACE_DISABLED);
83 wpa_msg(hapd->msg_ctx, MSG_INFO, AP_EVENT_DISABLED);
84 #ifdef CONFIG_FST
85 @@ -2723,6 +2728,7 @@ void hostapd_interface_deinit_free(struc
86 (unsigned int) iface->conf->num_bss);
87 driver = iface->bss[0]->driver;
88 drv_priv = iface->bss[0]->drv_priv;
89 + hostapd_ubus_free_iface(iface);
90 hostapd_interface_deinit(iface);
91 wpa_printf(MSG_DEBUG, "%s: driver=%p drv_priv=%p -> hapd_deinit",
92 __func__, driver, drv_priv);
93 --- a/src/ap/ieee802_11.c
94 +++ b/src/ap/ieee802_11.c
95 @@ -3573,13 +3573,18 @@ static void handle_auth(struct hostapd_d
96 u16 auth_alg, auth_transaction, status_code;
97 u16 resp = WLAN_STATUS_SUCCESS;
98 struct sta_info *sta = NULL;
99 - int res, reply_res;
100 + int res, reply_res, ubus_resp;
101 u16 fc;
102 const u8 *challenge = NULL;
103 u8 resp_ies[2 + WLAN_AUTH_CHALLENGE_LEN];
104 size_t resp_ies_len = 0;
105 u16 seq_ctrl;
106 struct radius_sta rad_info;
107 + struct hostapd_ubus_request req = {
108 + .type = HOSTAPD_UBUS_AUTH_REQ,
109 + .mgmt_frame = mgmt,
110 + .ssi_signal = rssi,
111 + };
112
113 if (len < IEEE80211_HDRLEN + sizeof(mgmt->u.auth)) {
114 wpa_printf(MSG_INFO, "handle_auth - too short payload (len=%lu)",
115 @@ -3747,6 +3752,13 @@ static void handle_auth(struct hostapd_d
116 resp = WLAN_STATUS_UNSPECIFIED_FAILURE;
117 goto fail;
118 }
119 + ubus_resp = hostapd_ubus_handle_event(hapd, &req);
120 + if (ubus_resp) {
121 + wpa_printf(MSG_DEBUG, "Station " MACSTR " rejected by ubus handler.\n",
122 + MAC2STR(mgmt->sa));
123 + resp = ubus_resp > 0 ? (u16) ubus_resp : WLAN_STATUS_UNSPECIFIED_FAILURE;
124 + goto fail;
125 + }
126 if (res == HOSTAPD_ACL_PENDING)
127 return;
128
129 @@ -5488,7 +5500,7 @@ static void handle_assoc(struct hostapd_
130 int resp = WLAN_STATUS_SUCCESS;
131 u16 reply_res = WLAN_STATUS_UNSPECIFIED_FAILURE;
132 const u8 *pos;
133 - int left, i;
134 + int left, i, ubus_resp;
135 struct sta_info *sta;
136 u8 *tmp = NULL;
137 #ifdef CONFIG_FILS
138 @@ -5701,6 +5713,11 @@ static void handle_assoc(struct hostapd_
139 left = res;
140 }
141 #endif /* CONFIG_FILS */
142 + struct hostapd_ubus_request req = {
143 + .type = HOSTAPD_UBUS_ASSOC_REQ,
144 + .mgmt_frame = mgmt,
145 + .ssi_signal = rssi,
146 + };
147
148 /* followed by SSID and Supported rates; and HT capabilities if 802.11n
149 * is used */
150 @@ -5799,6 +5816,13 @@ static void handle_assoc(struct hostapd_
151 }
152 #endif /* CONFIG_FILS */
153
154 + ubus_resp = hostapd_ubus_handle_event(hapd, &req);
155 + if (ubus_resp) {
156 + wpa_printf(MSG_DEBUG, "Station " MACSTR " assoc rejected by ubus handler.\n",
157 + MAC2STR(mgmt->sa));
158 + resp = ubus_resp > 0 ? (u16) ubus_resp : WLAN_STATUS_UNSPECIFIED_FAILURE;
159 + goto fail;
160 + }
161 fail:
162
163 /*
164 @@ -5892,6 +5916,7 @@ static void handle_disassoc(struct hosta
165 wpa_printf(MSG_DEBUG, "disassocation: STA=" MACSTR " reason_code=%d",
166 MAC2STR(mgmt->sa),
167 le_to_host16(mgmt->u.disassoc.reason_code));
168 + hostapd_ubus_notify(hapd, "disassoc", mgmt->sa);
169
170 sta = ap_get_sta(hapd, mgmt->sa);
171 if (sta == NULL) {
172 @@ -5961,6 +5986,8 @@ static void handle_deauth(struct hostapd
173 /* Clear the PTKSA cache entries for PASN */
174 ptksa_cache_flush(hapd->ptksa, mgmt->sa, WPA_CIPHER_NONE);
175
176 + hostapd_ubus_notify(hapd, "deauth", mgmt->sa);
177 +
178 sta = ap_get_sta(hapd, mgmt->sa);
179 if (sta == NULL) {
180 wpa_msg(hapd->msg_ctx, MSG_DEBUG, "Station " MACSTR " trying "
181 --- a/src/ap/beacon.c
182 +++ b/src/ap/beacon.c
183 @@ -919,6 +919,12 @@ void handle_probe_req(struct hostapd_dat
184 u16 csa_offs[2];
185 size_t csa_offs_len;
186 struct radius_sta rad_info;
187 + struct hostapd_ubus_request req = {
188 + .type = HOSTAPD_UBUS_PROBE_REQ,
189 + .mgmt_frame = mgmt,
190 + .ssi_signal = ssi_signal,
191 + .elems = &elems,
192 + };
193
194 if (hapd->iconf->rssi_ignore_probe_request && ssi_signal &&
195 ssi_signal < hapd->iconf->rssi_ignore_probe_request)
196 @@ -1105,6 +1111,12 @@ void handle_probe_req(struct hostapd_dat
197 }
198 #endif /* CONFIG_P2P */
199
200 + if (hostapd_ubus_handle_event(hapd, &req)) {
201 + wpa_printf(MSG_DEBUG, "Probe request for " MACSTR " rejected by ubus handler.\n",
202 + MAC2STR(mgmt->sa));
203 + return;
204 + }
205 +
206 /* TODO: verify that supp_rates contains at least one matching rate
207 * with AP configuration */
208
209 --- a/src/ap/drv_callbacks.c
210 +++ b/src/ap/drv_callbacks.c
211 @@ -145,6 +145,10 @@ int hostapd_notif_assoc(struct hostapd_d
212 u16 reason = WLAN_REASON_UNSPECIFIED;
213 int status = WLAN_STATUS_SUCCESS;
214 const u8 *p2p_dev_addr = NULL;
215 + struct hostapd_ubus_request req = {
216 + .type = HOSTAPD_UBUS_ASSOC_REQ,
217 + .addr = addr,
218 + };
219
220 if (addr == NULL) {
221 /*
222 @@ -237,6 +241,12 @@ int hostapd_notif_assoc(struct hostapd_d
223 goto fail;
224 }
225
226 + if (hostapd_ubus_handle_event(hapd, &req)) {
227 + wpa_printf(MSG_DEBUG, "Station " MACSTR " assoc rejected by ubus handler.\n",
228 + MAC2STR(req.addr));
229 + goto fail;
230 + }
231 +
232 #ifdef CONFIG_P2P
233 if (elems.p2p) {
234 wpabuf_free(sta->p2p_ie);
235 --- a/src/ap/sta_info.c
236 +++ b/src/ap/sta_info.c
237 @@ -460,6 +460,7 @@ void ap_handle_timer(void *eloop_ctx, vo
238 hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211,
239 HOSTAPD_LEVEL_INFO, "deauthenticated due to "
240 "local deauth request");
241 + hostapd_ubus_notify(hapd, "local-deauth", sta->addr);
242 ap_free_sta(hapd, sta);
243 return;
244 }
245 @@ -615,6 +616,7 @@ skip_poll:
246 mlme_deauthenticate_indication(
247 hapd, sta,
248 WLAN_REASON_PREV_AUTH_NOT_VALID);
249 + hostapd_ubus_notify(hapd, "inactive-deauth", sta->addr);
250 ap_free_sta(hapd, sta);
251 break;
252 }
253 @@ -1329,6 +1331,7 @@ void ap_sta_set_authorized(struct hostap
254 buf, ip_addr, keyid_buf);
255 } else {
256 wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_DISCONNECTED "%s", buf);
257 + hostapd_ubus_notify(hapd, "disassoc", sta->addr);
258
259 if (hapd->msg_ctx_parent &&
260 hapd->msg_ctx_parent != hapd->msg_ctx)
261 --- a/src/ap/wpa_auth_glue.c
262 +++ b/src/ap/wpa_auth_glue.c
263 @@ -268,6 +268,7 @@ static void hostapd_wpa_auth_psk_failure
264 struct hostapd_data *hapd = ctx;
265 wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_POSSIBLE_PSK_MISMATCH MACSTR,
266 MAC2STR(addr));
267 + hostapd_ubus_notify(hapd, "key-mismatch", addr);
268 }
269
270
271 --- a/wpa_supplicant/Makefile
272 +++ b/wpa_supplicant/Makefile
273 @@ -183,6 +183,12 @@ ifdef CONFIG_EAPOL_TEST
274 CFLAGS += -Werror -DEAPOL_TEST
275 endif
276
277 +ifdef CONFIG_UBUS
278 +CFLAGS += -DUBUS_SUPPORT
279 +OBJS += ubus.o
280 +LIBS += -lubox -lubus
281 +endif
282 +
283 ifdef CONFIG_CODE_COVERAGE
284 CFLAGS += -O0 -fprofile-arcs -ftest-coverage
285 LIBS += -lgcov
286 @@ -977,6 +983,9 @@ ifdef CONFIG_CTRL_IFACE_MIB
287 CFLAGS += -DCONFIG_CTRL_IFACE_MIB
288 endif
289 OBJS += ../src/ap/ctrl_iface_ap.o
290 +ifdef CONFIG_UBUS
291 +OBJS += ../src/ap/ubus.o
292 +endif
293 endif
294
295 CFLAGS += -DEAP_SERVER -DEAP_SERVER_IDENTITY
296 --- a/wpa_supplicant/wpa_supplicant.c
297 +++ b/wpa_supplicant/wpa_supplicant.c
298 @@ -7285,6 +7285,8 @@ struct wpa_supplicant * wpa_supplicant_a
299 }
300 #endif /* CONFIG_P2P */
301
302 + wpas_ubus_add_bss(wpa_s);
303 +
304 return wpa_s;
305 }
306
307 @@ -7311,6 +7313,8 @@ int wpa_supplicant_remove_iface(struct w
308 struct wpa_supplicant *parent = wpa_s->parent;
309 #endif /* CONFIG_MESH */
310
311 + wpas_ubus_free_bss(wpa_s);
312 +
313 /* Remove interface from the global list of interfaces */
314 prev = global->ifaces;
315 if (prev == wpa_s) {
316 @@ -7614,8 +7618,12 @@ int wpa_supplicant_run(struct wpa_global
317 eloop_register_signal_terminate(wpa_supplicant_terminate, global);
318 eloop_register_signal_reconfig(wpa_supplicant_reconfig, global);
319
320 + wpas_ubus_add(global);
321 +
322 eloop_run();
323
324 + wpas_ubus_free(global);
325 +
326 return 0;
327 }
328
329 --- a/wpa_supplicant/wpa_supplicant_i.h
330 +++ b/wpa_supplicant/wpa_supplicant_i.h
331 @@ -20,6 +20,7 @@
332 #include "wps/wps_defs.h"
333 #include "config_ssid.h"
334 #include "wmm_ac.h"
335 +#include "ubus.h"
336
337 extern const char *const wpa_supplicant_version;
338 extern const char *const wpa_supplicant_license;
339 @@ -323,6 +324,8 @@ struct wpa_global {
340 #endif /* CONFIG_WIFI_DISPLAY */
341
342 struct psk_list_entry *add_psk; /* From group formation */
343 +
344 + struct ubus_object ubus_global;
345 };
346
347
348 @@ -707,6 +710,7 @@ struct wpa_supplicant {
349 unsigned char own_addr[ETH_ALEN];
350 unsigned char perm_addr[ETH_ALEN];
351 char ifname[100];
352 + struct wpas_ubus_bss ubus;
353 #ifdef CONFIG_MATCH_IFACE
354 int matched;
355 #endif /* CONFIG_MATCH_IFACE */
356 --- a/wpa_supplicant/wps_supplicant.c
357 +++ b/wpa_supplicant/wps_supplicant.c
358 @@ -33,6 +33,7 @@
359 #include "p2p/p2p.h"
360 #include "p2p_supplicant.h"
361 #include "wps_supplicant.h"
362 +#include "ubus.h"
363
364
365 #ifndef WPS_PIN_SCAN_IGNORE_SEL_REG
366 @@ -391,6 +392,8 @@ static int wpa_supplicant_wps_cred(void
367 wpa_hexdump_key(MSG_DEBUG, "WPS: Received Credential attribute",
368 cred->cred_attr, cred->cred_attr_len);
369
370 + wpas_ubus_notify(wpa_s, cred);
371 +
372 if (wpa_s->conf->wps_cred_processing == 1)
373 return 0;
374
375 --- a/hostapd/main.c
376 +++ b/hostapd/main.c
377 @@ -897,6 +897,7 @@ int main(int argc, char *argv[])
378 }
379
380 hostapd_global_ctrl_iface_init(&interfaces);
381 + hostapd_ubus_add(&interfaces);
382
383 if (hostapd_global_run(&interfaces, daemonize, pid_file)) {
384 wpa_printf(MSG_ERROR, "Failed to start eloop");
385 @@ -906,6 +907,7 @@ int main(int argc, char *argv[])
386 ret = 0;
387
388 out:
389 + hostapd_ubus_free(&interfaces);
390 hostapd_global_ctrl_iface_deinit(&interfaces);
391 /* Deinitialize all interfaces */
392 for (i = 0; i < interfaces.count; i++) {
393 --- a/wpa_supplicant/main.c
394 +++ b/wpa_supplicant/main.c
395 @@ -204,7 +204,7 @@ int main(int argc, char *argv[])
396
397 for (;;) {
398 c = getopt(argc, argv,
399 - "b:Bc:C:D:de:f:g:G:hH:i:I:KLMm:No:O:p:P:qsTtuv::W");
400 + "b:Bc:C:D:de:f:g:G:hH:i:I:KLMm:nNo:O:p:P:qsTtuv::W");
401 if (c < 0)
402 break;
403 switch (c) {
404 @@ -272,6 +272,9 @@ int main(int argc, char *argv[])
405 params.conf_p2p_dev = optarg;
406 break;
407 #endif /* CONFIG_P2P */
408 + case 'n':
409 + iface_count = 0;
410 + break;
411 case 'o':
412 params.override_driver = optarg;
413 break;
414 --- a/src/ap/rrm.c
415 +++ b/src/ap/rrm.c
416 @@ -89,6 +89,9 @@ static void hostapd_handle_beacon_report
417 return;
418 wpa_msg(hapd->msg_ctx, MSG_INFO, BEACON_RESP_RX MACSTR " %u %02x %s",
419 MAC2STR(addr), token, rep_mode, report);
420 + if (len < sizeof(struct rrm_measurement_beacon_report))
421 + return;
422 + hostapd_ubus_notify_beacon_report(hapd, addr, token, rep_mode, (struct rrm_measurement_beacon_report*) pos, len);
423 }
424
425
426 @@ -352,6 +355,9 @@ void hostapd_handle_radio_measurement(st
427 mgmt->u.action.u.rrm.action, MAC2STR(mgmt->sa));
428
429 switch (mgmt->u.action.u.rrm.action) {
430 + case WLAN_RRM_LINK_MEASUREMENT_REPORT:
431 + hostapd_ubus_handle_link_measurement(hapd, buf, len);
432 + break;
433 case WLAN_RRM_RADIO_MEASUREMENT_REPORT:
434 hostapd_handle_radio_msmt_report(hapd, buf, len);
435 break;
436 --- a/src/ap/vlan_init.c
437 +++ b/src/ap/vlan_init.c
438 @@ -22,6 +22,7 @@
439 static int vlan_if_add(struct hostapd_data *hapd, struct hostapd_vlan *vlan,
440 int existsok)
441 {
442 + bool vlan_exists = iface_exists(vlan->ifname);
443 int ret;
444 #ifdef CONFIG_WEP
445 int i;
446 @@ -36,7 +37,7 @@ static int vlan_if_add(struct hostapd_da
447 }
448 #endif /* CONFIG_WEP */
449
450 - if (!iface_exists(vlan->ifname))
451 + if (!vlan_exists)
452 ret = hostapd_vlan_if_add(hapd, vlan->ifname);
453 else if (!existsok)
454 return -1;
455 @@ -51,6 +52,9 @@ static int vlan_if_add(struct hostapd_da
456 if (hapd->wpa_auth)
457 ret = wpa_auth_ensure_group(hapd->wpa_auth, vlan->vlan_id);
458
459 + if (!ret && !vlan_exists)
460 + hostapd_ubus_add_vlan(hapd, vlan);
461 +
462 if (ret == 0)
463 return ret;
464
465 @@ -77,6 +81,8 @@ int vlan_if_remove(struct hostapd_data *
466 "WPA deinitialization for VLAN %d failed (%d)",
467 vlan->vlan_id, ret);
468
469 + hostapd_ubus_remove_vlan(hapd, vlan);
470 +
471 return hostapd_vlan_if_remove(hapd, vlan->ifname);
472 }
473
474 --- a/src/ap/dfs.c
475 +++ b/src/ap/dfs.c
476 @@ -1203,6 +1203,8 @@ int hostapd_dfs_pre_cac_expired(struct h
477 "freq=%d ht_enabled=%d chan_offset=%d chan_width=%d cf1=%d cf2=%d",
478 freq, ht_enabled, chan_offset, chan_width, cf1, cf2);
479
480 + hostapd_ubus_notify_radar_detected(iface, freq, chan_width, cf1, cf2);
481 +
482 /* Proceed only if DFS is not offloaded to the driver */
483 if (iface->drv_flags & WPA_DRIVER_FLAGS_DFS_OFFLOAD)
484 return 0;
485 --- a/src/ap/airtime_policy.c
486 +++ b/src/ap/airtime_policy.c
487 @@ -112,8 +112,14 @@ static void set_sta_weights(struct hosta
488 {
489 struct sta_info *sta;
490
491 - for (sta = hapd->sta_list; sta; sta = sta->next)
492 - sta_set_airtime_weight(hapd, sta, weight);
493 + for (sta = hapd->sta_list; sta; sta = sta->next) {
494 + unsigned int sta_weight = weight;
495 +
496 + if (sta->dyn_airtime_weight)
497 + sta_weight = (weight * sta->dyn_airtime_weight) / 256;
498 +
499 + sta_set_airtime_weight(hapd, sta, sta_weight);
500 + }
501 }
502
503
504 @@ -244,7 +250,10 @@ int airtime_policy_new_sta(struct hostap
505 unsigned int weight;
506
507 if (hapd->iconf->airtime_mode == AIRTIME_MODE_STATIC) {
508 - weight = get_weight_for_sta(hapd, sta->addr);
509 + if (sta->dyn_airtime_weight)
510 + weight = sta->dyn_airtime_weight;
511 + else
512 + weight = get_weight_for_sta(hapd, sta->addr);
513 if (weight)
514 return sta_set_airtime_weight(hapd, sta, weight);
515 }
516 --- a/src/ap/sta_info.h
517 +++ b/src/ap/sta_info.h
518 @@ -328,6 +328,7 @@ struct sta_info {
519 #endif /* CONFIG_TESTING_OPTIONS */
520 #ifdef CONFIG_AIRTIME_POLICY
521 unsigned int airtime_weight;
522 + unsigned int dyn_airtime_weight;
523 struct os_reltime backlogged_until;
524 #endif /* CONFIG_AIRTIME_POLICY */
525
526 --- a/src/ap/wnm_ap.c
527 +++ b/src/ap/wnm_ap.c
528 @@ -455,7 +455,8 @@ static void ieee802_11_rx_bss_trans_mgmt
529 MAC2STR(addr), reason, hex ? " neighbor=" : "", hex);
530 os_free(hex);
531
532 - ieee802_11_send_bss_trans_mgmt_request(hapd, addr, dialog_token);
533 + if (!hostapd_ubus_notify_bss_transition_query(hapd, addr, dialog_token, reason, pos, end - pos))
534 + ieee802_11_send_bss_trans_mgmt_request(hapd, addr, dialog_token);
535 }
536
537
538 @@ -477,7 +478,7 @@ static void ieee802_11_rx_bss_trans_mgmt
539 size_t len)
540 {
541 u8 dialog_token, status_code, bss_termination_delay;
542 - const u8 *pos, *end;
543 + const u8 *pos, *end, *target_bssid = NULL;
544 int enabled = hapd->conf->bss_transition;
545 struct sta_info *sta;
546
547 @@ -524,6 +525,7 @@ static void ieee802_11_rx_bss_trans_mgmt
548 wpa_printf(MSG_DEBUG, "WNM: not enough room for Target BSSID field");
549 return;
550 }
551 + target_bssid = pos;
552 sta->agreed_to_steer = 1;
553 eloop_cancel_timeout(ap_sta_reset_steer_flag_timer, hapd, sta);
554 eloop_register_timeout(2, 0, ap_sta_reset_steer_flag_timer,
555 @@ -543,6 +545,10 @@ static void ieee802_11_rx_bss_trans_mgmt
556 MAC2STR(addr), status_code, bss_termination_delay);
557 }
558
559 + hostapd_ubus_notify_bss_transition_response(hapd, sta->addr, dialog_token,
560 + status_code, bss_termination_delay,
561 + target_bssid, pos, end - pos);
562 +
563 wpa_hexdump(MSG_DEBUG, "WNM: BSS Transition Candidate List Entries",
564 pos, end - pos);
565 }