Maybe instead of ip it should be IPv4? Since this seems like it only handles IPv4 addresses.
I find these couple of sentences a little confusing. Is this comment correct?
If an IPv4 address has been specified, it will be stripped out and passed out as the return value of this function in network byte order.
If no global default scheme has been specified and no scheme has been specified, we will assume that this is an NFS URL.
The pathname will be stored in the global variable rootpath.
Should this also cover IPv6?
Shouldn't we check if this is larger than FNAME_SIZE and if so, not actually pass it to inet_addr as it may be truncated? I assume that the reason we're trying to do it this way and not set the strchr result to '\0' is because we don't want to modify this?
If the parsed address is INADDR_NONE should we be warning about that? How does a user tell the difference between having no IP address specified, versus having a garbage IP address here. For example, if this includes the port, then that'll be there.
Is the reason for this that we want to capture the initial '/' character that's in the URI if none is there?
8797 loader: Support URI scheme for root-path in netbooting
Review Request #732 — Created Nov. 11, 2017 and submitted
Thanks for the follow ups.