summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorSascha Hauer <sha@pengutronix.de>2009-10-17 09:55:22 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2009-10-19 10:18:51 +0200
commit1d3d2c6369d4ccef4eff9e94f7925bc62221e29a (patch)
tree7806b23f75a7806e7ad3e1dfd49a15c0082ff458 /net
parentc229f67efb49070454f7a2474845d136e3db2733 (diff)
downloadbarebox-1d3d2c6369d4ccef4eff9e94f7925bc62221e29a.tar.gz
barebox-1d3d2c6369d4ccef4eff9e94f7925bc62221e29a.tar.xz
nfs: no default filename, we always have a filename
Signed-off-by: Sascha Hauer <sha@pengutronix.de>
Diffstat (limited to 'net')
-rw-r--r--net/nfs.c29
1 files changed, 8 insertions, 21 deletions
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);