From 1d3d2c6369d4ccef4eff9e94f7925bc62221e29a Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Sat, 17 Oct 2009 09:55:22 +0200 Subject: nfs: no default filename, we always have a filename Signed-off-by: Sascha Hauer --- net/nfs.c | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-) (limited to 'net') diff --git a/net/nfs.c b/net/nfs.c index 775e5a2412..f24763dfe3 100644 --- a/net/nfs.c +++ b/net/nfs.c @@ -59,7 +59,6 @@ static int NfsState; #define STATE_READ_REQ 6 #define STATE_READLINK_REQ 7 -static char default_filename[64]; static char *nfs_filename; static char *nfs_path; static char nfs_path_buff[2048]; @@ -651,6 +650,8 @@ NfsHandler (uchar *pkt, unsigned dest, unsigned src, unsigned len) void NfsStart (void) { + char *p = BootFile; + #ifdef NFS_DEBUG printf ("%s\n", __FUNCTION__); #endif @@ -665,28 +666,14 @@ NfsStart (void) return; } - if (BootFile[0] == '\0') { - sprintf (default_filename, "/nfsroot/%02lX%02lX%02lX%02lX.img", - NetOurIP & 0xFF, - (NetOurIP >> 8) & 0xFF, - (NetOurIP >> 16) & 0xFF, - (NetOurIP >> 24) & 0xFF ); - strcpy (nfs_path, default_filename); + p = strchr (p, ':'); - printf ("*** Warning: no boot file name; using '%s'\n", - nfs_path); + if (p != NULL) { + string_to_ip (BootFile, &NfsServerIP); + ++p; + strcpy (nfs_path, p); } else { - char *p=BootFile; - - p = strchr (p, ':'); - - if (p != NULL) { - string_to_ip (BootFile, &NfsServerIP); - ++p; - strcpy (nfs_path, p); - } else { - strcpy (nfs_path, BootFile); - } + strcpy (nfs_path, BootFile); } nfs_filename = basename (nfs_path); -- cgit v1.2.3