From 9f17f586f46b105599129ecf1083dd6884c0d24b Mon Sep 17 00:00:00 2001 From: David Cermak Date: Mon, 26 Jul 2021 11:27:47 +0200 Subject: [PATCH] esp_netif: Set default netif with lwip_netif Make use of lwip_netif pointer for setting the default interface in lwip, since the is a generic pointer used in I/O functions wheras the former is always the type. More importantly the netif_handle could be set to another context ptr used in I/O functions, as as for the SLIP netif. This change fixes the issue of incorrect settings of a default interface if any SLIP netif is involved. Closes https://github.com/espressif/esp-idf/issues/7246 --- components/esp_netif/lwip/esp_netif_lwip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/esp_netif/lwip/esp_netif_lwip.c b/components/esp_netif/lwip/esp_netif_lwip.c index 1ec5669b92..3b06f04f8f 100644 --- a/components/esp_netif/lwip/esp_netif_lwip.c +++ b/components/esp_netif/lwip/esp_netif_lwip.c @@ -178,7 +178,7 @@ static void esp_netif_set_default_netif(esp_netif_t *esp_netif) esp_netif_ppp_set_default_netif(esp_netif->netif_handle); #endif } else { - netif_set_default(esp_netif->netif_handle); + netif_set_default(esp_netif->lwip_netif); } }