Zhaoming Luo, le dim. 27 oct. 2024 22:58:48 +0800, a ecrit:
> Come across NETIF_FOREACH in /usr/include/lwip/lwip/netif.h, but I'm not
> sure if it affects some self-contained stuff.
> 
> netif.h belongs to liblwip-dev.

Applied, thanks!

> ---
>  lwip/iioctl-ops.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/lwip/iioctl-ops.c b/lwip/iioctl-ops.c
> index 14c4d585..f46b9cdb 100644
> --- a/lwip/iioctl-ops.c
> +++ b/lwip/iioctl-ops.c
> @@ -42,7 +42,7 @@ get_if (const char *name)
>    memcpy (ifname, name, IFNAMSIZ - 1);
>    ifname[IFNAMSIZ - 1] = 0;
>  
> -  for (netif = netif_list; netif != 0; netif = netif->next)
> +  NETIF_FOREACH(netif)
>      {
>        if (strcmp (netif_get_state (netif)->devname, ifname) == 0)
>       break;
> @@ -376,7 +376,7 @@ lwip_S_iioctl_siocgifindex (struct sock_user * user,
>      return EOPNOTSUPP;
>  
>    i = 1;                     /* The first index must be 1 */
> -  for (netif = netif_list; netif != 0; netif = netif->next)
> +  NETIF_FOREACH(netif)
>      {
>        if (strcmp (netif_get_state (netif)->devname, ifnam) == 0)
>       {
> @@ -410,7 +410,7 @@ lwip_S_iioctl_siocgifname (struct sock_user * user,
>      return EINVAL;
>  
>    i = 1;                     /* The first index is 1 */
> -  for (netif = netif_list; netif != 0; netif = netif->next)
> +  NETIF_FOREACH(netif)
>      {
>        if (i == *index)
>       break;
> -- 
> 2.47.0
> 
> 

-- 
Samuel
 > et sinon, quand on s'interesse a un media que l'on ne maitrise pas,
 > on essaye de le comprendre d'abord.
 (Suivi par l'intégralité du message initial de 45 lignes.)
 -+-BM in : GNU - La maîtrise est un long apprentissage petit scarabé -+-

Reply via email to