Merge branch 'bugfix/eapol_drop_issue_v4.4' into 'release/v4.4'

esp_wifi: clear old keys before going for new connection(backport v4.4)

See merge request espressif/esp-idf!18996
This commit is contained in:
Jiang Jiang Jian 2022-07-13 15:40:11 +08:00
commit 322a2240f1
2 changed files with 7 additions and 6 deletions

@ -1 +1 @@
Subproject commit dc92d42a7393277597759a91e99e80fdd3f81da5
Subproject commit 693f0c2134e551b120fcb30dc5b929414a413a48

View File

@ -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;
}