From 522e0a6b061e5b86da1941863c3cc139ce7c327e Mon Sep 17 00:00:00 2001 From: Kapil Gupta Date: Tue, 12 Jul 2022 10:43:34 +0530 Subject: [PATCH] esp_wifi: clear old keys before going for new connection --- components/esp_wifi/lib | 2 +- .../wpa_supplicant/esp_supplicant/src/esp_wps.c | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/components/esp_wifi/lib b/components/esp_wifi/lib index dc92d42a73..693f0c2134 160000 --- a/components/esp_wifi/lib +++ b/components/esp_wifi/lib @@ -1 +1 @@ -Subproject commit dc92d42a7393277597759a91e99e80fdd3f81da5 +Subproject commit 693f0c2134e551b120fcb30dc5b929414a413a48 diff --git a/components/wpa_supplicant/esp_supplicant/src/esp_wps.c b/components/wpa_supplicant/esp_supplicant/src/esp_wps.c index bf2bc34935..9ff091fe4a 100644 --- a/components/wpa_supplicant/esp_supplicant/src/esp_wps.c +++ b/components/wpa_supplicant/esp_supplicant/src/esp_wps.c @@ -277,9 +277,9 @@ int wps_post(uint32_t sig, uint32_t par) } #endif -static void wps_sendto_wrapper(void *buffer, uint16_t len) +static int wps_sendto_wrapper(void *buffer, uint16_t len) { - esp_wifi_internal_tx(WIFI_IF_STA, buffer, len); + return esp_wifi_internal_tx(WIFI_IF_STA, buffer, len); } /* @@ -301,9 +301,7 @@ static inline int wps_sm_ether_send(struct wps_sm *sm, const u8 *dest, u16 proto os_memcpy(eth->h_source, sm->ownaddr, ETH_ALEN); eth->h_proto = host_to_be16(proto); - wps_sendto_wrapper(buffer, sizeof(struct l2_ethhdr) + data_len); - - return ESP_OK; + return wps_sendto_wrapper(buffer, sizeof(struct l2_ethhdr) + data_len); } @@ -648,6 +646,7 @@ int wps_send_eap_identity_rsp(u8 id) eap_buf = eap_msg_alloc(EAP_VENDOR_IETF, EAP_TYPE_IDENTITY, sm->identity_len, EAP_CODE_RESPONSE, id); if (!eap_buf) { + wpa_printf(MSG_ERROR, "eap buf allocation failed"); ret = ESP_FAIL; goto _err; } @@ -663,12 +662,14 @@ int wps_send_eap_identity_rsp(u8 id) buf = wps_sm_alloc_eapol(sm, IEEE802_1X_TYPE_EAP_PACKET, wpabuf_head_u8(eap_buf), wpabuf_len(eap_buf), (size_t *)&len, NULL); if (!buf) { + wpa_printf(MSG_ERROR, "buf allocation failed"); ret = ESP_ERR_NO_MEM; goto _err; } ret = wps_sm_ether_send(sm, bssid, ETH_P_EAPOL, buf, len); if (ret) { + wpa_printf(MSG_ERROR, "wps sm ether send failed ret=%d", ret); ret = ESP_FAIL; goto _err; }