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);