From: Chris Packham <judge.packham@gmail.com>
Date: Thu, 3 May 2018 08:19:03 +0000 (+1200)
Subject: net: bootp: Fix compile error processing ntpserver option
X-Git-Tag: v2025.01-rc5-pxa1908~4301
X-Git-Url: http://git.dujemihanovic.xyz/html/static/gitweb.css?a=commitdiff_plain;h=4b4dc5211e1df7a85fbe7a83ac8e64ee81879e1b;p=u-boot.git

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.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
---

diff --git a/net/bootp.c b/net/bootp.c
index efa959971c..9d7cb5d30c 100644
--- a/net/bootp.c
+++ b/net/bootp.c
@@ -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
 }