瀏覽代碼

net: cancel timeout handler after DHCPACK

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>
Stefan Brüns 9 年之前
父節點
當前提交
4f28c9b169
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      net/bootp.c

+ 1 - 0
net/bootp.c

@@ -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");