From 676902de168bbf52ee8deea2fae64b4e34fd97b3 Mon Sep 17 00:00:00 2001 From: "wangtao@espressif.com" Date: Thu, 30 Apr 2026 11:46:01 +0800 Subject: [PATCH] fix(lwip): fix lost ip event issue --- components/esp_netif/lwip/esp_netif_lwip.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/components/esp_netif/lwip/esp_netif_lwip.c b/components/esp_netif/lwip/esp_netif_lwip.c index cbdbb3040c9..74d66697cd0 100644 --- a/components/esp_netif/lwip/esp_netif_lwip.c +++ b/components/esp_netif/lwip/esp_netif_lwip.c @@ -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 */ @@ -1584,13 +1584,11 @@ static esp_err_t esp_netif_start_ip_lost_timer(esp_netif_t *esp_netif) ESP_LOGV(TAG, "%s esp_netif:%p", __func__, esp_netif); - if (esp_netif->timer_running) { - ESP_LOGD(TAG, "if%p start ip lost tmr: already started", esp_netif); - return ESP_OK; - } - #if CONFIG_ESP_NETIF_LOST_IP_TIMER_ENABLE if ( netif && (CONFIG_ESP_NETIF_IP_LOST_TIMER_INTERVAL > 0)) { + if (esp_netif->timer_running) { + sys_untimeout(esp_netif_ip_lost_timer, (void *)esp_netif); + } esp_netif->timer_running = true; sys_timeout(CONFIG_ESP_NETIF_IP_LOST_TIMER_INTERVAL * 1000, esp_netif_ip_lost_timer, (void *)esp_netif); ESP_LOGD(TAG, "if%p start ip lost tmr: interval=%d", esp_netif, CONFIG_ESP_NETIF_IP_LOST_TIMER_INTERVAL);