diff mbox

[U-Boot] net: cancel timeout handler after DHCPACK

Message ID 1e094f19-d650-4a7a-b89d-d4f0a7aa2924@HUB2.rwth-ad.de
State Accepted
Delegated to: Joe Hershberger
Headers show

Commit Message

Stefan Brüns Aug. 30, 2015, 3:47 p.m. UTC
Timeout handler should be stopped after reception of DHCPACK. If "autoload"
is not set, the handler is immediately replaced by the TFTP handler,
otherwise it may trigger before the next boot stage begins.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
---
 net/bootp.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Joe Hershberger Oct. 28, 2015, 7:49 p.m. UTC | #1
On Sun, Aug 30, 2015 at 10:47 AM, Stefan Brüns
<stefan.bruens@rwth-aachen.de> wrote:
> Timeout handler should be stopped after reception of DHCPACK. If "autoload"
> is not set, the handler is immediately replaced by the TFTP handler,
> otherwise it may trigger before the next boot stage begins.
>
> Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>

Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Joe Hershberger Oct. 29, 2015, 7:33 p.m. UTC | #2
On Sun, Aug 30, 2015 at 10:47 AM, Stefan Brüns
<stefan.bruens@rwth-aachen.de> wrote:
> Timeout handler should be stopped after reception of DHCPACK. If "autoload"
> is not set, the handler is immediately replaced by the TFTP handler,
> otherwise it may trigger before the next boot stage begins.
>
> Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>

Applied to u-boot-net/master, thanks!
-Joe
diff mbox

Patch

diff --git a/net/bootp.c b/net/bootp.c
index c6b0847..ac14044 100644
--- a/net/bootp.c
+++ b/net/bootp.c
@@ -1026,6 +1026,7 @@  static void dhcp_handler(uchar *pkt, unsigned dest, struct in_addr sip,
 			dhcp_state = BOUND;
 			printf("DHCP client bound to address %pI4 (%lu ms)\n",
 			       &net_ip, get_timer(bootp_start));
+			net_set_timeout_handler(0, (thand_f *)0);
 			bootstage_mark_name(BOOTSTAGE_ID_BOOTP_STOP,
 					    "bootp_stop");