summaryrefslogtreecommitdiffstats
path: root/net/dhcp.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2012-04-29 13:56:27 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2012-04-30 13:28:56 +0200
commitcac75c0f2397f760d4d346219b2b9249b45872f1 (patch)
tree3101c6e2429d78e0fc059c3dfe157378a2d9cfb7 /net/dhcp.c
parent47f8cf2d0875c6dc1107a7559c458eeac08a16dd (diff)
downloadbarebox-cac75c0f2397f760d4d346219b2b9249b45872f1.tar.gz
barebox-cac75c0f2397f760d4d346219b2b9249b45872f1.tar.xz
dhcp: set start time
The dhcp command starts with an unitialized start time. The start time is often long in the past which results in an immediate timeout and resend of the dhcp packet. Fix this by initializing the start time correctly. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'net/dhcp.c')
-rw-r--r--net/dhcp.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/dhcp.c b/net/dhcp.c
index 0c882fb041..bd3ac1a297 100644
--- a/net/dhcp.c
+++ b/net/dhcp.c
@@ -651,6 +651,7 @@ static int do_dhcp(int argc, char *argv[])
net_set_ip(0);
+ dhcp_start = get_time_ns();
ret = bootp_request(); /* Basically same as BOOTP */
if (ret)
goto out1;