bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/4] lwip: Fix wrong error checks


From: Samuel Thibault
Subject: Re: [PATCH 1/4] lwip: Fix wrong error checks
Date: Sun, 31 Mar 2019 20:01:14 +0200
User-agent: NeoMutt/20170113 (1.7.2)

Joan Lledó, le dim. 31 mars 2019 19:55:38 +0200, a ecrit:
> * lwip/lwip-util.c: init_ifs():
>       * Check for the value of ifc instead of in->dev_name
> * lwip/port/netif/ifcommon.c:
>       * if_init(), if_terminate(): Check for null on ifc instead of netif

Applied, thanks!

> ---
>  lwip/lwip-util.c           | 4 ++--
>  lwip/port/netif/ifcommon.c | 4 ++--
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/lwip/lwip-util.c b/lwip/lwip-util.c
> index 57a94d52..69991b4c 100644
> --- a/lwip/lwip-util.c
> +++ b/lwip/lwip-util.c
> @@ -181,7 +181,7 @@ init_ifs (void *arg)
>        /*
>         * Create a new interface and configre IPv4.
>         *
> -       * Fifth parameter (in->name) is a hook.
> +       * Fifth parameter (ifc) is a hook.
>         */
>        err = netifapi_netif_add
>       (netif, &in->address, &in->netmask, &in->gateway, &ifc, if_init,
> @@ -189,7 +189,7 @@ init_ifs (void *arg)
>        if (err)
>       {
>         /* The interface failed to init */
> -       if (netif->state != in->dev_name)
> +       if (netif->state != &ifc)
>           /* It failed after setting the control block, must free it */
>           mem_free (netif->state);
>         free (netif);
> diff --git a/lwip/port/netif/ifcommon.c b/lwip/port/netif/ifcommon.c
> index 11ede76d..c6179683 100644
> --- a/lwip/port/netif/ifcommon.c
> +++ b/lwip/port/netif/ifcommon.c
> @@ -75,7 +75,7 @@ if_init (struct netif * netif)
>  {
>    struct ifcommon *ifc = netif_get_state (netif);
>  
> -  if (netif == NULL)
> +  if (ifc == NULL)
>      /* The user provided no interface */
>      return -1;
>  
> @@ -89,7 +89,7 @@ if_terminate (struct netif * netif)
>    error_t err;
>    struct ifcommon *ifc = netif_get_state (netif);
>  
> -  if (netif == NULL)
> +  if (ifc == NULL)
>      /* The user provided no interface */
>      return -1;
>  
> -- 
> 2.17.1
> 
> 

-- 
Samuel
 Les roots ne sont plus ce qu'ils étaient...Maintenant il sont dioxinés,
 c'est de la m... ! Avant on les élevaient avec du bon unix mais ça été
 remplacé par des farines industrielles nouvelles technologies (NT).
 -+- JdK in NPC : Exigez un root élevé sous la mère ! -+-



reply via email to

[Prev in Thread] Current Thread [Next in Thread]