net: Add Kconfig option for BOOTP_NTPSERVER
PATCH v2 1/2 net: Add Kconfig option for BOOTP_NTPSERVER
Add a Kconfig option for BOOTP_NTPSERVER to enable the DHCP/BOOTP option to configure the sntp server address.
---
Changes in v2:
- update devkit8000 config
- remove from config_whitelist.txt
cmd/Kconfig | 4 ++++ configs/devkit8000_defconfig | 1 + include/configs/devkit8000.h | 1 - scripts/config_whitelist.txt | 1 - 4 files changed, 5 insertions(+), 2 deletions(-)
cmd/Kconfig +4 -0
@@ -1086,6 +1086,10 @@ config BOOTP_SUBNETMASK default y depends on CMD_BOOTP +config BOOTP_NTPSERVER + bool "Request & store 'ntpserverip' from BOOTP/DHCP server" + depends on CMD_BOOTP + config BOOTP_PXE bool "Send PXE client arch to BOOTP/DHCP server" default y
configs/devkit8000_defconfig +1 -0
@@ -18,6 +18,7 @@ CONFIG_CMD_MMC=y CONFIG_CMD_NAND=y CONFIG_CMD_NAND_LOCK_UNLOCK=y # CONFIG_CMD_SETEXPR is not set +CONFIG_BOOTP_NTPSERVER=y CONFIG_CMD_JFFS2=y CONFIG_CMD_MTDPARTS=y CONFIG_MTDIDS_DEFAULT="nand0=nand"
include/configs/devkit8000.h +0 -1
@@ -82,7 +82,6 @@#define CONFIG_BOOTP_BOOTFILESIZE #define CONFIG_BOOTP_DNS2 #define CONFIG_BOOTP_SEND_HOSTNAME -#define CONFIG_BOOTP_NTPSERVER #define CONFIG_BOOTP_TIMEOFFSET #undef CONFIG_BOOTP_VENDOREX
scripts/config_whitelist.txt +0 -1
@@ -157,7 +157,6 @@ CONFIG_BOOTP_DHCP_REQUEST_DELAY CONFIG_BOOTP_ID_CACHE_SIZE CONFIG_BOOTP_MAY_FAIL CONFIG_BOOTP_NISDOMAIN -CONFIG_BOOTP_NTPSERVER CONFIG_BOOTP_RANDOM_DELAY CONFIG_BOOTP_SEND_HOSTNAME CONFIG_BOOTP_SERVERIP
Signature · 1 line
2.17.0
PATCH v2 2/2 net: bootp: Fix compile error processing ntpserver option
When the following configuration is set
# CONFIG_CMD_DHCP is not set
CONFIG_CMD_BOOTP=y
CONFIG_BOOTP_NTPSERVER=y
The following compile error is observed
error: used struct type value where scalar is required
if (net_ntp_server)
^~~~~~~~~~~~~~Resolve this by checking net_ntp_server.s_addr instead.
---
Changes in v2:
- collect Ack from Joe
net/bootp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/bootp.c +1 -1
@@ -333,7 +333,7 @@ static void bootp_process_vendor(u8 *ext, int size)debug ("net_nis_domain : %s\n" , net_nis_domain);#if defined(CONFIG_CMD_SNTP ) && defined(CONFIG_BOOTP_NTPSERVER ) -if (net_ntp_server) +if (net_ntp_server.s_addr)debug ("net_ntp_server : %pI4\n" , &net_ntp_server);#endif }
Signature · 1 line
2.17.0
PATCH v2 2/2 net: bootp: Fix compile error processing ntpserver option
Quoted 8 lines · Chris Packham
When the following configuration is set
#
CONFIG_CMD_DHCPis not set
CONFIG_CMD_BOOTP=y
CONFIG_BOOTP_NTPSERVER=yThe following compile error is observed
Quoted 8 lines
error: used struct type value where scalar is required
if (net_ntp_server) ^~~~~~~~~~~~~~Resolve this by checking net_ntp_server.s_addr instead.
Signed-off-by Chris Packham <[email protected]>Acked-by Joe Hershberger <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180515/d10e39f8/attachment.sig>
PATCH v2 1/2 net: Add Kconfig option for BOOTP_NTPSERVER
In reply to Chris PackhamQuoted 4 lines · Chris Packham
Add a
Kconfigoption forBOOTP_NTPSERVERto enable the DHCP/BOOTP option to configure the sntp server address.Signed-off-by Chris Packham <[email protected]>
PATCH v2 1/2 net: Add Kconfig option for BOOTP_NTPSERVER
In reply to Chris PackhamQuoted 5 lines · Chris Packham
Add a
Kconfigoption forBOOTP_NTPSERVERto enable the DHCP/BOOTP option to configure the sntp server address.Signed-off-by Chris Packham <[email protected]>Acked-by Joe Hershberger <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180515/47086bdc/attachment.sig>