mirror of
https://xff.cz/git/u-boot/
synced 2025-09-01 16:52:14 +02:00
net: When checking prerequisites, consider boot_file_name
For net_boot_common, we allow the serverip to be specified as part of the boot file name. For net commands that require serverip, include that source as a valid specification of serverip. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Reviewed-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
@@ -839,6 +839,9 @@ ushort env_get_vlan(char *);
|
|||||||
/* copy a filename (allow for "..." notation, limit length) */
|
/* copy a filename (allow for "..." notation, limit length) */
|
||||||
void copy_filename(char *dst, const char *src, int size);
|
void copy_filename(char *dst, const char *src, int size);
|
||||||
|
|
||||||
|
/* check if serverip is specified in filename from the command line */
|
||||||
|
int is_serverip_in_cmd(void);
|
||||||
|
|
||||||
/* get a random source port */
|
/* get a random source port */
|
||||||
unsigned int random_port(void);
|
unsigned int random_port(void);
|
||||||
|
|
||||||
|
@@ -1341,7 +1341,7 @@ static int net_check_prereq(enum proto_t protocol)
|
|||||||
/* Fall through */
|
/* Fall through */
|
||||||
case TFTPGET:
|
case TFTPGET:
|
||||||
case TFTPPUT:
|
case TFTPPUT:
|
||||||
if (net_server_ip.s_addr == 0) {
|
if (net_server_ip.s_addr == 0 && !is_serverip_in_cmd()) {
|
||||||
puts("*** ERROR: `serverip' not set\n");
|
puts("*** ERROR: `serverip' not set\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -1512,6 +1512,11 @@ void copy_filename(char *dst, const char *src, int size)
|
|||||||
*dst = '\0';
|
*dst = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int is_serverip_in_cmd(void)
|
||||||
|
{
|
||||||
|
return !!strchr(net_boot_file_name, ':');
|
||||||
|
}
|
||||||
|
|
||||||
#if defined(CONFIG_CMD_NFS) || \
|
#if defined(CONFIG_CMD_NFS) || \
|
||||||
defined(CONFIG_CMD_SNTP) || \
|
defined(CONFIG_CMD_SNTP) || \
|
||||||
defined(CONFIG_CMD_DNS)
|
defined(CONFIG_CMD_DNS)
|
||||||
|
Reference in New Issue
Block a user