aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeonid Iziumtsev <leonid.iziumtsev@gmail.com>2018-03-09 15:29:06 +0100
committerJoe Hershberger <joe.hershberger@ni.com>2018-03-22 15:05:31 -0500
commit17d413b2531aa4bb2a97514f130bd520deee4ada (patch)
tree59742752bef03163035e7f0b5bdd2e7e26120273
parentb321c44ac9e2569fcc07def3e150fcfe4554a1b0 (diff)
downloadu-boot-midas-17d413b2531aa4bb2a97514f130bd520deee4ada.tar.gz
u-boot-midas-17d413b2531aa4bb2a97514f130bd520deee4ada.tar.bz2
u-boot-midas-17d413b2531aa4bb2a97514f130bd520deee4ada.zip
net: Fix netretry condition
The "net_try_count" counter starts from "1". And the "retrycnt" contains requested amount of retries. With current logic, that means that the actual retry amount will be one time less then what we set in "netretry" env. For example setting "netretry" to "once" will make "retrycnt" equal "1", so no retries will be triggered at all. Fix the logic by changing the statement of "if" condition. Signed-off-by: Leonid Iziumtsev <leonid.iziumtsev@se.atlascopco.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
-rw-r--r--net/net.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/net.c b/net/net.c
index 4259c9e321..8a9b69c6b0 100644
--- a/net/net.c
+++ b/net/net.c
@@ -683,7 +683,7 @@ int net_start_again(void)
retry_forever = 0;
}
- if ((!retry_forever) && (net_try_count >= retrycnt)) {
+ if ((!retry_forever) && (net_try_count > retrycnt)) {
eth_halt();
net_set_state(NETLOOP_FAIL);
/*