All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: Fix error if some network features are disabled
@ 2020-03-09 14:27 Krebs, Olaf
  2020-06-12 21:15 ` Tom Rini
  0 siblings, 1 reply; 2+ messages in thread
From: Krebs, Olaf @ 2020-03-09 14:27 UTC (permalink / raw)
  To: u-boot

If 'CONFIG_CMD_TFTPBOOT' or 'CONFIG_CMD_BOOTP' are disabled, the usage must be disabled, too!

Signed-off-by: Olaf Krebs <olaf.krebs@emh-metering.com>
CC: Joe Hershberger <joe.hershberger@ni.com>
---
 cmd/net.c | 6 ++++++
 net/net.c | 6 ++++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/cmd/net.c b/cmd/net.c
index 1b724cc570..f4f57d9e56 100644
--- a/cmd/net.c
+++ b/cmd/net.c
@@ -129,11 +129,15 @@ static void netboot_update_env(void)
 		env_set("netmask", tmp);
 	}
 
+#ifdef CONFIG_CMD_BOOTP
 	if (net_hostname[0])
 		env_set("hostname", net_hostname);
+#endif
 
+#ifdef CONFIG_CMD_BOOTP
 	if (net_root_path[0])
 		env_set("rootpath", net_root_path);
+#endif
 
 	if (net_ip.s_addr) {
 		ip_to_string(net_ip, tmp);
@@ -159,8 +163,10 @@ static void netboot_update_env(void)
 		env_set("dnsip2", tmp);
 	}
 #endif
+#ifdef CONFIG_CMD_BOOTP
 	if (net_nis_domain[0])
 		env_set("domain", net_nis_domain);
+#endif
 
 #if defined(CONFIG_CMD_SNTP) && defined(CONFIG_BOOTP_TIMEOFFSET)
 	if (net_ntp_time_offset) {
diff --git a/net/net.c b/net/net.c
index 087d399a24..21f6e60e6e 100644
--- a/net/net.c
+++ b/net/net.c
@@ -454,6 +454,7 @@ restart:
 		net_dev_exists = 1;
 		net_boot_file_size = 0;
 		switch (protocol) {
+#ifdef CONFIG_CMD_TFTPBOOT
 		case TFTPGET:
 #ifdef CONFIG_CMD_TFTPPUT
 		case TFTPPUT:
@@ -461,6 +462,7 @@ restart:
 			/* always use ARP to get server ethernet address */
 			tftp_start(protocol);
 			break;
+#endif
 #ifdef CONFIG_CMD_TFTPSRV
 		case TFTPSRV:
 			tftp_start_server();
@@ -478,13 +480,13 @@ restart:
 			dhcp_request();		/* Basically same as BOOTP */
 			break;
 #endif
-
+#if defined(CONFIG_CMD_BOOTP)
 		case BOOTP:
 			bootp_reset();
 			net_ip.s_addr = 0;
 			bootp_request();
 			break;
-
+#endif
 #if defined(CONFIG_CMD_RARP)
 		case RARP:
 			rarp_try = 0;
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH] net: Fix error if some network features are disabled
  2020-03-09 14:27 [PATCH] net: Fix error if some network features are disabled Krebs, Olaf
@ 2020-06-12 21:15 ` Tom Rini
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Rini @ 2020-06-12 21:15 UTC (permalink / raw)
  To: u-boot

On Mon, Mar 09, 2020 at 02:27:55PM +0000, Krebs, Olaf wrote:

> If 'CONFIG_CMD_TFTPBOOT' or 'CONFIG_CMD_BOOTP' are disabled, the usage must be disabled, too!
> 
> Signed-off-by: Olaf Krebs <olaf.krebs@emh-metering.com>
> CC: Joe Hershberger <joe.hershberger@ni.com>

Applied to u-boot/next, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200612/70f14715/attachment.sig>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-06-12 21:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-09 14:27 [PATCH] net: Fix error if some network features are disabled Krebs, Olaf
2020-06-12 21:15 ` Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.