From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jean-Christophe PLAGNIOL-VILLARD Date: Fri, 11 Jan 2008 01:12:35 +0100 Subject: [U-Boot-Users] [PATCH 0/1] TFTP: add host ip addr support In-Reply-To: <4786AB4D.8070109@bluewatersys.com> References: <20080109225326.48B6A242E7@gemini.denx.de> <1200006097-7454-1-git-send-email-plagnioj@jcrosoft.com> <4786AB4D.8070109@bluewatersys.com> Message-ID: <20080111001235.GA21026@game.jcrosoft.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 12:33 Fri 11 Jan , Andre Renaud wrote: > Jean-Christophe PLAGNIOL-VILLARD wrote: > 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); > + } > I will prefer + TftpServerIP = NetServerIP; if (BootFile[0] == '\0') { sprintf(default_filename, "%02lX%02lX%02lX%02lX.img", NetOurIP & 0xFF, @@ -464,19 +465,26 @@ 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); > 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