All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] net: dhcp: Allow "MAY_FAIL" to still try each adapter
@ 2017-11-08  2:13 Wilson Lee
  2018-01-22 16:54 ` [U-Boot] " Joe Hershberger
  0 siblings, 1 reply; 2+ messages in thread
From: Wilson Lee @ 2017-11-08  2:13 UTC (permalink / raw)
  To: u-boot

From: Joe Hershberger <joe.hershberger@ni.com>

This change allows the "MAY_FAIL" DHCP option to still attempt to
contact a DHCP server on each adapter and only give up once each
adapter has failed once.  To get the existing behavior, set the
already-existing ethrotate=no variable.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Cc: Keng Soon Cheah <keng.soon.cheah@ni.com>
Cc: Chen Yee Chew <chen.yee.chew@ni.com>
---
 net/bootp.c | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/net/bootp.c b/net/bootp.c
index 73370a1..cb724e9 100644
--- a/net/bootp.c
+++ b/net/bootp.c
@@ -387,12 +387,19 @@ static void bootp_timeout_handler(void)
 
 	if (time_taken >= time_taken_max) {
 #ifdef CONFIG_BOOTP_MAY_FAIL
-		puts("\nRetry time exceeded\n");
-		net_set_state(NETLOOP_FAIL);
-#else
-		puts("\nRetry time exceeded; starting again\n");
-		net_start_again();
+		char *ethrotate;
+
+		ethrotate = getenv("ethrotate");
+		if ((ethrotate != NULL && strcmp(ethrotate, "no") == 0) ||
+		    net_restart_wrap) {
+			puts("\nRetry time exceeded\n");
+			net_set_state(NETLOOP_FAIL);
+		} else
 #endif
+		{
+			puts("\nRetry time exceeded; starting again\n");
+			net_start_again();
+		}
 	} else {
 		bootp_timeout *= 2;
 		if (bootp_timeout > 2000)
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [U-Boot] net: dhcp: Allow "MAY_FAIL" to still try each adapter
  2017-11-08  2:13 [U-Boot] [PATCH] net: dhcp: Allow "MAY_FAIL" to still try each adapter Wilson Lee
@ 2018-01-22 16:54 ` Joe Hershberger
  0 siblings, 0 replies; 2+ messages in thread
From: Joe Hershberger @ 2018-01-22 16:54 UTC (permalink / raw)
  To: u-boot

Hi Wilson,

https://patchwork.ozlabs.org/patch/835530/ was applied to http://git.denx.de/?p=u-boot/u-boot-net.git

Thanks!
-Joe

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-01-22 16:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-08  2:13 [U-Boot] [PATCH] net: dhcp: Allow "MAY_FAIL" to still try each adapter Wilson Lee
2018-01-22 16:54 ` [U-Boot] " Joe Hershberger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.