[U-Boot-Users] [PATCH 0/1] TFTP: add host ip addr support

Andre Renaud andre at bluewatersys.com
Fri Jan 11 00:33:33 CET 2008


Jean-Christophe PLAGNIOL-VILLARD wrote:
> @@ -464,19 +464,27 @@ TftpStart (void)
>  		printf ("*** Warning: no boot file name; using '%s'\n",
>  			tftp_filename);
>  	} else {
> -		tftp_filename = BootFile;
> +		char *p=BootFile;
> +		p = strchr (p, ':');
> +		if (p != NULL) {
> +			TftpServerIP = string_to_ip (BootFile);
> +			++p;
> +			strcpy (tftp_filename, p);
> +		} else {
> +			strcpy (tftp_filename, BootFile);
> +		}

Doesn't this mean that TftpServerIP will be undefined if no server is
specified. Should it not be:

@@ -464,19 +464,27 @@ TftpStart (void)
 		printf ("*** Warning: no boot file name; using '%s'\n",
 			tftp_filename);
 	} else {
-		tftp_filename = BootFile;
+		char *p=BootFile;
+		p = strchr (p, ':');
+		if (p != NULL) {
+			TftpServerIP = string_to_ip (BootFile);
+			++p;
+			strcpy (tftp_filename, p);
+		} else {
+			TftpServerIP = NetServerIP;
+			strcpy (tftp_filename, BootFile);
+		}

Andre

-- 
Bluewater Systems Ltd - ARM Technology Solutions Centre

       Andre Renaud                             Bluewater Systems Ltd
Phone: +64 3 3779127 (Aus 1 800 148 751)        Level 17, 119 Armagh St
Fax:   +64 3 3779135                            PO Box 13889
Email: arenaud at bluewatersys.com                 Christchurch
Web:   http://www.bluewatersys.com              New Zealand




More information about the U-Boot mailing list