diff --git a/modules/hostap/src/hapd_events.c b/modules/hostap/src/hapd_events.c index 2d297b71aff..deb4c1705de 100644 --- a/modules/hostap/src/hapd_events.c +++ b/modules/hostap/src/hapd_events.c @@ -69,13 +69,15 @@ int hostapd_send_wifi_mgmt_ap_sta_event(struct hostapd_iface *ap_ctx, void *data) { struct sta_info *sta = data; - char *ifname = ap_ctx->bss[0]->conf->iface; + char *ifname; struct wifi_ap_sta_info sta_info = { 0 }; if (!ap_ctx || !sta) { return -EINVAL; } + ifname = ap_ctx->bss[0]->conf->iface; + memcpy(sta_info.mac, sta->addr, sizeof(sta_info.mac)); if (event == NET_EVENT_WIFI_CMD_AP_STA_CONNECTED) {