summaryrefslogtreecommitdiff
path: root/net/nfs.c
diff options
context:
space:
mode:
authorJoe Hershberger <joe.hershberger@ni.com>2018-07-03 19:36:43 -0500
committerJoe Hershberger <joe.hershberger@ni.com>2018-07-26 14:08:20 -0500
commit6ab12830921c1de4eb90a0d471bf5f4677af734c (patch)
treee843a02a84a0797ab7d0dbb7e4e4cc8d3cb0a3a9 /net/nfs.c
parentf43308fa0c7834d9707a2c212591275d1e095e50 (diff)
net: Consolidate the parsing of bootfile
The same basic parsing was implemented in tftp and nfs, so add a helper function to do the work once. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Diffstat (limited to 'net/nfs.c')
-rw-r--r--net/nfs.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/net/nfs.c b/net/nfs.c
index 86dfe9a494..d6a7f8e827 100644
--- a/net/nfs.c
+++ b/net/nfs.c
@@ -859,7 +859,8 @@ void nfs_start(void)
return;
}
- if (net_boot_file_name[0] == '\0') {
+ if (!net_parse_bootfile(&nfs_server_ip, nfs_path,
+ sizeof(nfs_path_buff))) {
sprintf(nfs_path, "/nfsroot/%02X%02X%02X%02X.img",
net_ip.s_addr & 0xFF,
(net_ip.s_addr >> 8) & 0xFF,
@@ -868,18 +869,6 @@ void nfs_start(void)
printf("*** Warning: no boot file name; using '%s'\n",
nfs_path);
- } else {
- char *p = net_boot_file_name;
-
- p = strchr(p, ':');
-
- if (p != NULL) {
- nfs_server_ip = string_to_ip(net_boot_file_name);
- ++p;
- strcpy(nfs_path, p);
- } else {
- strcpy(nfs_path, net_boot_file_name);
- }
}
nfs_filename = basename(nfs_path);