mirror of
https://xff.cz/git/u-boot/
synced 2025-09-01 08:42:12 +02:00
net: Fix error if some network features are disabled
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>
This commit is contained in:
@@ -135,11 +135,15 @@ static void netboot_update_env(void)
|
|||||||
env_set("netmask", tmp);
|
env_set("netmask", tmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CONFIG_CMD_BOOTP
|
||||||
if (net_hostname[0])
|
if (net_hostname[0])
|
||||||
env_set("hostname", net_hostname);
|
env_set("hostname", net_hostname);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_CMD_BOOTP
|
||||||
if (net_root_path[0])
|
if (net_root_path[0])
|
||||||
env_set("rootpath", net_root_path);
|
env_set("rootpath", net_root_path);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (net_ip.s_addr) {
|
if (net_ip.s_addr) {
|
||||||
ip_to_string(net_ip, tmp);
|
ip_to_string(net_ip, tmp);
|
||||||
@@ -165,8 +169,10 @@ static void netboot_update_env(void)
|
|||||||
env_set("dnsip2", tmp);
|
env_set("dnsip2", tmp);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef CONFIG_CMD_BOOTP
|
||||||
if (net_nis_domain[0])
|
if (net_nis_domain[0])
|
||||||
env_set("domain", net_nis_domain);
|
env_set("domain", net_nis_domain);
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_CMD_SNTP) && defined(CONFIG_BOOTP_TIMEOFFSET)
|
#if defined(CONFIG_CMD_SNTP) && defined(CONFIG_BOOTP_TIMEOFFSET)
|
||||||
if (net_ntp_time_offset) {
|
if (net_ntp_time_offset) {
|
||||||
|
@@ -456,6 +456,7 @@ restart:
|
|||||||
net_dev_exists = 1;
|
net_dev_exists = 1;
|
||||||
net_boot_file_size = 0;
|
net_boot_file_size = 0;
|
||||||
switch (protocol) {
|
switch (protocol) {
|
||||||
|
#ifdef CONFIG_CMD_TFTPBOOT
|
||||||
case TFTPGET:
|
case TFTPGET:
|
||||||
#ifdef CONFIG_CMD_TFTPPUT
|
#ifdef CONFIG_CMD_TFTPPUT
|
||||||
case TFTPPUT:
|
case TFTPPUT:
|
||||||
@@ -463,6 +464,7 @@ restart:
|
|||||||
/* always use ARP to get server ethernet address */
|
/* always use ARP to get server ethernet address */
|
||||||
tftp_start(protocol);
|
tftp_start(protocol);
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
#ifdef CONFIG_CMD_TFTPSRV
|
#ifdef CONFIG_CMD_TFTPSRV
|
||||||
case TFTPSRV:
|
case TFTPSRV:
|
||||||
tftp_start_server();
|
tftp_start_server();
|
||||||
@@ -480,13 +482,13 @@ restart:
|
|||||||
dhcp_request(); /* Basically same as BOOTP */
|
dhcp_request(); /* Basically same as BOOTP */
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(CONFIG_CMD_BOOTP)
|
||||||
case BOOTP:
|
case BOOTP:
|
||||||
bootp_reset();
|
bootp_reset();
|
||||||
net_ip.s_addr = 0;
|
net_ip.s_addr = 0;
|
||||||
bootp_request();
|
bootp_request();
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
#if defined(CONFIG_CMD_RARP)
|
#if defined(CONFIG_CMD_RARP)
|
||||||
case RARP:
|
case RARP:
|
||||||
rarp_try = 0;
|
rarp_try = 0;
|
||||||
|
Reference in New Issue
Block a user