Skip to content

Commit 28f12bf

Browse files
committed
fix(esp_wifi): Deinit WPS registrar during hostapd deinit
1 parent 13d4235 commit 28f12bf

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

components/wpa_supplicant/esp_supplicant/src/esp_hostap.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "esp_wifi_types.h"
2020
#include "esp_wpa3_i.h"
2121
#include "esp_wps.h"
22+
#include "esp_wps_i.h"
2223

2324
#define WIFI_PASSWORD_LEN_MAX 65
2425

@@ -236,6 +237,9 @@ bool hostap_deinit(void *data)
236237
esp_wifi_unset_appie_internal(WIFI_APPIE_WPA);
237238
esp_wifi_unset_appie_internal(WIFI_APPIE_ASSOC_RESP);
238239

240+
#ifdef CONFIG_WPS_REGISTRAR
241+
wifi_ap_wps_disable_internal();
242+
#endif
239243
#ifdef CONFIG_SAE
240244
wpa3_hostap_auth_deinit();
241245
/* Wait till lock is released by wpa3 task */

components/wpa_supplicant/esp_supplicant/src/esp_wpa3.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,23 +367,27 @@ int wpa3_hostap_post_evt(uint32_t evt_id, uint32_t data)
367367
if (g_wpa3_hostap_evt_queue == NULL) {
368368
WPA3_HOSTAP_AUTH_API_UNLOCK();
369369
os_free(evt);
370+
wpa_printf(MSG_DEBUG, "hostap evt queue NULL");
370371
return ESP_FAIL;
371372
}
372373
} else {
373374
os_free(evt);
375+
wpa_printf(MSG_DEBUG, "g_wpa3_hostap_auth_api_lock not found");
374376
return ESP_FAIL;
375377
}
376378
if (evt->id == SIG_WPA3_RX_CONFIRM || evt->id == SIG_TASK_DEL) {
377379
/* prioritising confirm for completing handshake for committed sta */
378380
if (os_queue_send_to_front(g_wpa3_hostap_evt_queue, &evt, 0) != pdPASS) {
379381
WPA3_HOSTAP_AUTH_API_UNLOCK();
382+
wpa_printf(MSG_DEBUG, "failed to add msg to queue front");
380383
os_free(evt);
381384
return ESP_FAIL;
382385
}
383386
} else {
384387
if (os_queue_send(g_wpa3_hostap_evt_queue, &evt, 0) != pdPASS) {
385388
WPA3_HOSTAP_AUTH_API_UNLOCK();
386389
os_free(evt);
390+
wpa_printf(MSG_DEBUG, "failed to send msg to queue");
387391
return ESP_FAIL;
388392
}
389393
}

components/wpa_supplicant/esp_supplicant/src/esp_wps_i.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,3 +148,4 @@ static inline int wps_set_status(uint32_t status)
148148
bool is_wps_enabled(void);
149149
int wps_init_cfg_pin(struct wps_config *cfg);
150150
void wifi_station_wps_eapol_start_handle(void *data, void *user_ctx);
151+
int wifi_ap_wps_disable_internal(void);

0 commit comments

Comments
 (0)