Skip to content

Commit

Permalink
fix(lwip): Fixed compilation error referencing undefined POSIX interf…
Browse files Browse the repository at this point in the history
…ace API

Closes #13577
  • Loading branch information
espressif-abhikroy committed Jun 14, 2024
1 parent 6a4396c commit 6567f0b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
4 changes: 4 additions & 0 deletions components/lwip/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ if(CONFIG_LWIP_ENABLE)
"port/sockets_ext.c"
"port/freertos/sys_arch.c")

if(CONFIG_LWIP_NETIF_API)
list(APPEND srcs "port/if_index.c")
endif()

if(CONFIG_LWIP_PPP_SUPPORT)
list(APPEND srcs
"lwip/src/netif/ppp/auth.c"
Expand Down
17 changes: 17 additions & 0 deletions components/lwip/port/if_index.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/

#include "lwip/if_api.h"

unsigned int if_nametoindex(const char *ifname)
{
return lwip_if_nametoindex(ifname);
}

char *if_indextoname(unsigned int ifindex, char *ifname)
{
return lwip_if_indextoname(ifindex, ifname);
}

0 comments on commit 6567f0b

Please sign in to comment.