bug-hurd
[Top][All Lists]
Advanced

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

Re: [PATCH 1/2] lwip: Fix bug: Error handling on configure_device()


From: Samuel Thibault
Subject: Re: [PATCH 1/2] lwip: Fix bug: Error handling on configure_device()
Date: Sat, 11 May 2019 10:47:27 +0200
User-agent: NeoMutt/20170113 (1.7.2)

Joan Lledó, le sam. 11 mai 2019 10:30:39 +0200, a ecrit:
> @@ -357,9 +357,9 @@ configure_device (struct netif *netif, uint32_t addr, 
> uint32_t netmask,
>        arg->addr6 = addr6;
>        arg->addr6_prefix_len = addr6_prefix_len;
>        err = tcpip_callback (update_if, arg);
> -      if (err)
> -     return err;
> +      if (err == ERR_MEM)
> +     return EAGAIN;

Instead of special-casing ERR_MEM in particular (in the future
tcppi_callback could want to return other kinds of errors), I'd say
rather use err_to_errno() (provided in lwip/src/api/err.c)

And you can just set err to that errno value, which will be returned by:

>      }
>  
> -  return errno;
> +  return err;


Samuel



reply via email to

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