diff options
author | Thomas RIENOESSL <thomas.rienoessl@bachmann.info> | 2018-11-21 15:56:07 +0100 |
---|---|---|
committer | Joe Hershberger <joe.hershberger@ni.com> | 2019-01-24 11:35:28 -0600 |
commit | a735e6e9d639114d67e4440f9e051a89d2094118 (patch) | |
tree | af72ba9ce4264b5610ec830ec9108a7d5d9eba1f /net | |
parent | 21586cdd50dbcb9572514d5288f8cbdc17e23264 (diff) | |
download | u-boot-a735e6e9d639114d67e4440f9e051a89d2094118.tar.gz |
net: explicitly assign errno to return code in case of network failure
When dealing with two ethernet ports and having "netretry" set
to "once", it could occur that the connection (e.g. an ARP
request) failed, hence the status of the netloop was
"NETLOOP_FAIL". Due to the setting of "netretry", the network
logic would then switch to the other network interface,
assigning "ret" with the return value of "net_start_again()".
If this call succeeded we would return 0 (i.e. success) to
the caller when in reality the network action failed.
Signed-off-by: Thomas RIENOESSL <thomas.rienoessl@bachmann.info>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/net.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -657,6 +657,7 @@ restart: /* Invalidate the last protocol */ eth_set_last_protocol(BOOTP); debug_cond(DEBUG_INT_STATE, "--- net_loop Fail!\n"); + ret = -ENONET; goto done; case NETLOOP_CONTINUE: |