From 95b5ef368722714431d6ae0d993b3a7e18dc76e4 Mon Sep 17 00:00:00 2001 From: David Cermak Date: Mon, 18 May 2020 21:58:49 +0200 Subject: [PATCH] esp-netif: wifi-deinit to clear handlers only in tcpip-adapter mode --- components/tcpip_adapter/tcpip_adapter_compat.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/components/tcpip_adapter/tcpip_adapter_compat.c b/components/tcpip_adapter/tcpip_adapter_compat.c index cd970f4c89..e8e9479ac4 100644 --- a/components/tcpip_adapter/tcpip_adapter_compat.c +++ b/components/tcpip_adapter/tcpip_adapter_compat.c @@ -178,7 +178,12 @@ esp_err_t tcpip_adapter_set_default_wifi_handlers(void) esp_err_t tcpip_adapter_clear_default_wifi_handlers(void) { - return _esp_wifi_clear_default_wifi_handlers(); + if (s_tcpip_adapter_compat) { + // Clear default handlers only if tcpip-adapter mode used + return _esp_wifi_clear_default_wifi_handlers(); + } + // No action if tcpip-adapter compatibility enabled, but interfaces created/configured with esp-netif + return ESP_OK; } tcpip_adapter_if_t tcpip_adapter_if_from_esp_netif(esp_netif_t *esp_netif)