fix(lwip): esp_netif supports esp_netif_get_netif_impl() for PPP

This commit is contained in:
David Cermak 2024-01-08 09:47:49 +01:00 committed by David Čermák
parent 63e8e01646
commit d707161881
2 changed files with 3 additions and 7 deletions

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD * SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
@ -29,10 +29,7 @@ extern "C" {
esp_netif_t* esp_netif_get_handle_from_netif_impl(void *dev); esp_netif_t* esp_netif_get_handle_from_netif_impl(void *dev);
/** /**
* @brief Returns network stack specific implementation handle (if supported) * @brief Returns network stack specific implementation handle
*
* Note that it is not supported to acquire PPP netif impl pointer and
* this function will return NULL for esp_netif instances configured to PPP mode
* *
* @param[in] esp_netif Handle to esp-netif instance * @param[in] esp_netif Handle to esp-netif instance
* *

View File

@ -495,8 +495,7 @@ esp_netif_t* esp_netif_get_handle_from_netif_impl(void *dev)
void* esp_netif_get_netif_impl(esp_netif_t *esp_netif) void* esp_netif_get_netif_impl(esp_netif_t *esp_netif)
{ {
// get impl ptr only for vanilla lwip impl (ppp_pcb not supported) if (esp_netif) {
if (esp_netif && !ESP_NETIF_IS_POINT2POINT_TYPE(esp_netif, PPP_LWIP_NETIF)) {
return esp_netif->lwip_netif; return esp_netif->lwip_netif;
} }
return NULL; return NULL;