Set own MAC address in AP data structures
[wpasupplicant] / wpa_supplicant / ap.c
index ab2345f..9c8bdad 100644 (file)
@@ -58,6 +58,7 @@ struct ap_driver_data {
 static void * ap_driver_init(struct hostapd_data *hapd)
 {
        struct ap_driver_data *drv;
+       struct wpa_supplicant *wpa_s = hapd->iface->owner;
 
        drv = os_zalloc(sizeof(struct ap_driver_data));
        if (drv == NULL) {
@@ -66,6 +67,7 @@ static void * ap_driver_init(struct hostapd_data *hapd)
                return NULL;
        }
        drv->hapd = hapd;
+       os_memcpy(hapd->own_addr, wpa_s->own_addr, ETH_ALEN);
 
        return drv;
 }
@@ -155,8 +157,9 @@ static int ap_driver_sta_remove(void *priv, const u8 *addr)
 static int ap_driver_send_mgmt_frame(void *priv, const void *data, size_t len,
                                     int flags)
 {
-       wpa_printf(MSG_DEBUG, "AP TODO: %s", __func__);
-       return -1;
+       struct ap_driver_data *drv = priv;
+       struct wpa_supplicant *wpa_s = drv->hapd->iface->owner;
+       return wpa_drv_send_mlme(wpa_s, data, len);
 }