From 17d413b2531aa4bb2a97514f130bd520deee4ada Mon Sep 17 00:00:00 2001 From: Leonid Iziumtsev Date: Fri, 9 Mar 2018 15:29:06 +0100 Subject: [PATCH] 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 Acked-by: Joe Hershberger --- net/net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); /* -- 2.39.2