From: Joan Lledó <[email protected]>
It was returning invalid values not related to actual internal indexes for
ifaces
---
lwip/iioctl-ops.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/lwip/iioctl-ops.c b/lwip/iioctl-ops.c
index 1c61a1a0..875bfb75 100644
--- a/lwip/iioctl-ops.c
+++ b/lwip/iioctl-ops.c
@@ -580,21 +580,17 @@ lwip_S_iioctl_siocgifindex (struct sock_user * user,
{
kern_return_t err = 0;
struct netif *netif;
- int i;
if (!user)
return EOPNOTSUPP;
- i = 1; /* The first index must be 1 */
NETIF_FOREACH(netif)
{
if (strcmp (netif_get_state (netif)->devname, ifnam) == 0)
{
- *index = i;
+ *index = netif_get_index (netif);
break;
}
-
- i++;
}
if (!netif)
--
2.50.1