Page MenuHomeFreeBSD

D10854.1778420390.diff
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

D10854.1778420390.diff

Index: sys/boot/common/dev_net.c
===================================================================
--- sys/boot/common/dev_net.c
+++ sys/boot/common/dev_net.c
@@ -334,9 +334,7 @@
return (EIO);
}
exit:
- netproto = NET_TFTP;
if ((rootaddr = net_parse_rootpath()) != INADDR_NONE) {
- netproto = NET_NFS;
rootip.s_addr = rootaddr;
}
@@ -387,14 +385,25 @@
uint32_t
net_parse_rootpath()
{
- n_long addr = INADDR_NONE;
- char *ptr;
+ n_long addr;
+ char *ptr, *val;
+
+ addr = INADDR_NONE;
+ netproto = NET_NFS;
+ ptr = rootpath;
+
+ if (strncmp(rootpath, "tftp://", strlen("tftp://")) == 0) {
+ netproto = NET_TFTP;
+ ptr = rootpath + strlen("tftp://");
+ } else if (strncmp(rootpath, "nfs://", strlen("nfs://")) == 0) {
+ netproto = NET_NFS;
+ ptr = rootpath + strlen("nfs://");
+ }
- ptr = rootpath;
- (void)strsep(&ptr, ":");
- if (ptr != NULL) {
- addr = inet_addr(rootpath);
- bcopy(ptr, rootpath, strlen(ptr)+1);
+ val = strsep(&ptr, ":");
+ if (ptr != NULL) {
+ addr = inet_addr(val);
+ bcopy(ptr, rootpath, strlen(ptr) + 1);
}
return (addr);

File Metadata

Mime Type
text/plain
Expires
Sun, May 10, 1:39 PM (2 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28636976
Default Alt Text
D10854.1778420390.diff (1 KB)

Event Timeline