Merge branch 'bugfix/roaming_app_issues_v6.0' into 'release/v6.0'

fix(esp_wifi): Fixed some issues in roaming app found using static analysis (v6.0)

See merge request espressif/esp-idf!48353
This commit is contained in:
Jiang Jiang Jian
2026-05-14 10:56:02 +08:00
9 changed files with 1762 additions and 279 deletions
+5 -5
View File
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2019-2025 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2019-2026 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -29,7 +29,7 @@ static esp_netif_t *s_wifi_netifs[MAX_WIFI_IFS] = { NULL };
static bool wifi_default_handlers_set = false;
static esp_err_t disconnect_and_destroy(esp_netif_t* esp_netif);
#ifdef CONFIG_ESP_WIFI_NETWORK_ASSISTED_ROAMING_IP_RENEW_SKIP
#ifdef CONFIG_ESP_WIFI_ROAMING_IP_RENEW_SKIP
static bool roaming_ongoing = false;
#endif
@@ -85,7 +85,7 @@ static void wifi_default_action_sta_stop(void *arg, esp_event_base_t base, int32
{
#ifdef CONFIG_ESP_WIFI_ENABLE_ROAMING_APP
roam_disable_reconnect();
#ifdef CONFIG_ESP_WIFI_NETWORK_ASSISTED_ROAMING_IP_RENEW_SKIP
#ifdef CONFIG_ESP_WIFI_ROAMING_IP_RENEW_SKIP
roaming_ongoing = false;
#endif
#endif /* CONFIG_ESP_WIFI_ENABLE_ROAMING_APP */
@@ -98,7 +98,7 @@ static void wifi_default_action_sta_connected(void *arg, esp_event_base_t base,
{
#if CONFIG_ESP_WIFI_ENABLE_ROAMING_APP
roam_sta_connected();
#ifdef CONFIG_ESP_WIFI_NETWORK_ASSISTED_ROAMING_IP_RENEW_SKIP
#ifdef CONFIG_ESP_WIFI_ROAMING_IP_RENEW_SKIP
if (roaming_ongoing) {
/* IP stack is already in ready state */
roaming_ongoing = false;
@@ -127,7 +127,7 @@ static void wifi_default_action_sta_disconnected(void *arg, esp_event_base_t bas
{
#if CONFIG_ESP_WIFI_ENABLE_ROAMING_APP
roam_sta_disconnected(data);
#ifdef CONFIG_ESP_WIFI_NETWORK_ASSISTED_ROAMING_IP_RENEW_SKIP
#ifdef CONFIG_ESP_WIFI_ROAMING_IP_RENEW_SKIP
wifi_event_sta_disconnected_t *disconn = data;
if (disconn->reason == WIFI_REASON_ROAMING) {
roaming_ongoing = true;