summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorJoe Hershberger <joe.hershberger@ni.com>2017-11-07 18:13:40 -0800
committerJoe Hershberger <joe.hershberger@ni.com>2018-01-15 12:05:23 -0600
commit2099b9f27cebdbee1ff28ccf146c8dba8a922118 (patch)
tree2346b18c45aa420efc2fdb4b20d035640ffd1404 /net
parentd5d5757291509f0716f6c24a391a3ae1f51042be (diff)
net: dhcp: Allow "MAY_FAIL" to still try each adapter
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>
Diffstat (limited to 'net')
-rw-r--r--net/bootp.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/net/bootp.c b/net/bootp.c
index 59bb2099f1..efa959971c 100644
--- a/net/bootp.c
+++ b/net/bootp.c
@@ -386,12 +386,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 = env_get("ethrotate");
+ if ((ethrotate && 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)