Skip to content

Commit

Permalink
Merge branch 'lwip/if_indextoname_compolation_fix_v5.1' into 'release…
Browse files Browse the repository at this point in the history
…/v5.1'

fix(lwip): Fixed compilation error referencing undefined POSIX interface API (v5.1)

See merge request espressif/esp-idf!31407
  • Loading branch information
jack0c committed Jul 2, 2024
2 parents 4422bed + 4e2e2b2 commit 597331d
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 @@ -131,6 +131,10 @@ if(CONFIG_LWIP_PPP_SUPPORT)
"lwip/src/netif/ppp/polarssl/md4.c"
"lwip/src/netif/ppp/polarssl/md5.c"
"lwip/src/netif/ppp/polarssl/sha1.c")

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

if(NOT ${target} STREQUAL "linux")
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 597331d

Please sign in to comment.