diff options
author | Joan Lledó <joanlluislledo@gmail.com> | 2019-05-11 11:32:02 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2019-05-11 11:42:42 +0200 |
commit | 524e2fb5a031f1d7bee74abbd270ddbc8e1e334f (patch) | |
tree | 667a48fa17c61f4d05600a61d590803372e63bfc /lwip | |
parent | 7d10ab8bb1447e5848052bd59e25225e772c4457 (diff) | |
download | hurd-524e2fb5a031f1d7bee74abbd270ddbc8e1e334f.tar.gz hurd-524e2fb5a031f1d7bee74abbd270ddbc8e1e334f.tar.bz2 hurd-524e2fb5a031f1d7bee74abbd270ddbc8e1e334f.zip |
lwip: Fix bug: Error handling on configure_device()
* lwip/lwip-util.c:
* EINVAL was never being returned.
* Return error code for tcpip_callback() as errno.
Message-Id: <20190511093202.9763-2-jlledom@member.fsf.org>
Diffstat (limited to 'lwip')
-rw-r--r-- | lwip/lwip-util.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lwip/lwip-util.c b/lwip/lwip-util.c index 4f632185..61f3194a 100644 --- a/lwip/lwip-util.c +++ b/lwip/lwip-util.c @@ -253,7 +253,7 @@ static void update_if (void *arg) { int i; - struct update_if_args *args = (struct update_if_args *) arg; + struct update_if_args *args = arg; netif_set_addr (args->netif, (ip4_addr_t *) & args->addr, (ip4_addr_t *) & args->netmask, @@ -356,10 +356,8 @@ configure_device (struct netif *netif, uint32_t addr, uint32_t netmask, arg->gateway = gateway; arg->addr6 = addr6; arg->addr6_prefix_len = addr6_prefix_len; - err = tcpip_callback (update_if, arg); - if (err) - return err; + err = err_to_errno(tcpip_callback (update_if, arg)); } - return errno; + return err; } |