mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-12-20 17:01:50 +01:00
net: lwip: dhcp: make NTP servers usable by the sntp command
When both CMD_DHCP and CMD_SNTP are enabled, one would expect the NTP servers received by DHCP to be used by the sntp command by default. Fix dhcp_loop() so that it is indeed the case. Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reported-by: Michal Simek <michal.simek@amd.com>
This commit is contained in:
parent
4462ab9a0b
commit
57a623230e
@ -8,6 +8,7 @@
|
|||||||
#include <dm/device.h>
|
#include <dm/device.h>
|
||||||
#include <linux/delay.h>
|
#include <linux/delay.h>
|
||||||
#include <linux/errno.h>
|
#include <linux/errno.h>
|
||||||
|
#include <lwip/apps/sntp.h>
|
||||||
#include <lwip/dhcp.h>
|
#include <lwip/dhcp.h>
|
||||||
#include <lwip/dns.h>
|
#include <lwip/dns.h>
|
||||||
#include <lwip/timeouts.h>
|
#include <lwip/timeouts.h>
|
||||||
@ -48,6 +49,13 @@ static int dhcp_loop(struct udevice *udev)
|
|||||||
if (!netif)
|
if (!netif)
|
||||||
return CMD_RET_FAILURE;
|
return CMD_RET_FAILURE;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Request the DHCP stack to parse and store the NTP servers for
|
||||||
|
* eventual use by the SNTP command
|
||||||
|
*/
|
||||||
|
if (CONFIG_IS_ENABLED(CMD_SNTP))
|
||||||
|
sntp_servermode_dhcp(1);
|
||||||
|
|
||||||
start = get_timer(0);
|
start = get_timer(0);
|
||||||
|
|
||||||
if (dhcp_start(netif))
|
if (dhcp_start(netif))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user