summaryrefslogtreecommitdiff
path: root/net/bootp.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2016-02-26 14:56:23 -0500
committerTom Rini <trini@konsulko.com>2016-02-26 14:56:23 -0500
commit38e65aeb70b72132c0d2ec0ed389f7fc8b7bdf4c (patch)
tree40fc8c566aa0f3c5b37c8e725513998d5de064ce /net/bootp.c
parentcf23b4da624f32639d5cb9de6e3c9069ffd26ae5 (diff)
parent50768f5b06e7704cf2bc209f89e250130c3fff5b (diff)
Merge branch 'master' of git://git.denx.de/u-boot-net
Diffstat (limited to 'net/bootp.c')
-rw-r--r--net/bootp.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/net/bootp.c b/net/bootp.c
index f2978a23ce5..aefc808391a 100644
--- a/net/bootp.c
+++ b/net/bootp.c
@@ -60,6 +60,8 @@ char net_nis_domain[32] = {0,}; /* Our NIS domain */
char net_hostname[32] = {0,}; /* Our hostname */
char net_root_path[64] = {0,}; /* Our bootpath */
+static ulong time_taken_max;
+
#if defined(CONFIG_CMD_DHCP)
static dhcp_state_t dhcp_state = INIT;
static u32 dhcp_leasetime;
@@ -380,7 +382,7 @@ static void bootp_timeout_handler(void)
{
ulong time_taken = get_timer(bootp_start);
- if (time_taken >= TIMEOUT_MS) {
+ if (time_taken >= time_taken_max) {
#ifdef CONFIG_BOOTP_MAY_FAIL
puts("\nRetry time exceeded\n");
net_set_state(NETLOOP_FAIL);
@@ -675,12 +677,19 @@ void bootp_request(void)
u32 bootp_id;
struct in_addr zero_ip;
struct in_addr bcast_ip;
+ char *ep; /* Environment pointer */
bootstage_mark_name(BOOTSTAGE_ID_BOOTP_START, "bootp_start");
#if defined(CONFIG_CMD_DHCP)
dhcp_state = INIT;
#endif
+ ep = getenv("bootpretryperiod");
+ if (ep != NULL)
+ time_taken_max = simple_strtoul(ep, NULL, 10);
+ else
+ time_taken_max = TIMEOUT_MS;
+
#ifdef CONFIG_BOOTP_RANDOM_DELAY /* Random BOOTP delay */
if (bootp_try == 0)
srand_mac();