]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
net: cancel timeout handler after DHCPACK
authorStefan Brüns <stefan.bruens@rwth-aachen.de>
Sun, 30 Aug 2015 15:47:17 +0000 (17:47 +0200)
committerJoe Hershberger <joe.hershberger@ni.com>
Wed, 28 Oct 2015 19:58:13 +0000 (14:58 -0500)
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>
net/bootp.c

index 1316f00dd8462e5317c1f21499ad489320d277d5..5d1edf1dcb3a46d1da4bb3ff574986430e1386ef 100644 (file)
@@ -1018,6 +1018,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");