Page MenuHomeFreeBSD

Add support for protocol prefixes in rootpath
AbandonedPublic

Authored by kczekirda on May 22 2017, 12:40 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Dec 10, 6:56 AM
Unknown Object (File)
Sun, Dec 1, 5:57 PM
Unknown Object (File)
Sun, Nov 24, 6:17 PM
Unknown Object (File)
Nov 15 2024, 5:02 PM
Unknown Object (File)
Sep 18 2024, 2:18 AM
Unknown Object (File)
Aug 31 2024, 10:55 PM
Unknown Object (File)
Aug 29 2024, 1:39 AM
Unknown Object (File)
Aug 28 2024, 9:14 PM
Subscribers

Details

Summary

If rootpath starts with protocol prefix, then set them.

Sponsored by: Oktawave
Relnote: Yes

Test Plan

valid rootpaths:

"/tftproot"
"192.168.1.1:/tftproot"
"tftp:///tftproot"
"tftp://192.168.1.1:/tftproot"

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

sys/boot/common/dev_net.c
395

I would suggest something a bit more generic;

struct root_path_prefix {

const char *rp_prefix;
int rp_netproto;

}

make an array of the values, and in the code just walk the array based on nitems().

rgrimes added a subscriber: rgrimes.

I have no problem with this code going in as it is here, it can be evolved with a table post commit.

sys/boot/common/dev_net.c
395

I like this idea of array of protocols, but I think we should only walk that if there is a :// in the string, then if we do not find a match in the table return an error that the protocol is not (yet) supported?

This revision is now accepted and ready to land.May 22 2017, 4:19 PM
sys/boot/common/dev_net.c
395

I'd just walk the table, then check ip:/path and then just fall back to tftp (as default). I mean, its not like we will get huge table and the rootpath is set only at the very beginning anyhow.

I don't like the current approach as it is not a valid URI parser

for example with that approach tftp://ip/something will not work
or tftp:/something will not work either.

tftp://192.168.1.1:/tftproot is weird

I would accept tftp://<ip>/path or tftp:/path

and only keep <ip>:/path for compatibility for nfs

In the futur with http we will want http://ip[:port]/path so the format