fix(lwip): Remove if_indextoname() impl in favor of LWIP_NETIF_API

ESP-IDF already hardcodes LWIP_NETIF_API=1, so the related netif APIs are
defined unconditionally.
This commit is contained in:
David Cermak
2025-01-29 17:06:23 +01:00
committed by David Čermák
parent 86089be928
commit 42d2a131f6
2 changed files with 0 additions and 31 deletions

View File

@@ -46,11 +46,7 @@ static void app_multiple_handle(esp_ip4_addr_t *ip4_addr, esp_netif_t *esp_netif
*/
#if CONFIG_EXAMPLE_BIND_SOCKET_TO_NETIF_NAME
struct ifreq ifr;
#if !CONFIG_LWIP_NETIF_API
esp_netif_get_netif_impl_name(esp_netif, ifr.ifr_name);
#else
if_indextoname(esp_netif_get_netif_impl_index(esp_netif), ifr.ifr_name);
#endif
int ret = setsockopt(sock, SOL_SOCKET, SO_BINDTODEVICE, (void*)&ifr, sizeof(struct ifreq));
if (ret < 0) {
ESP_LOGE(TAG, "\"%s\" Unable to bind socket to specified interface: errno %d", netif_name, errno);