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)
Feb 12 2024, 9:42 PM
Unknown Object (File)
Jan 15 2024, 12:19 PM
Unknown Object (File)
Jan 13 2024, 2:58 AM
Unknown Object (File)
Dec 23 2023, 12:20 AM
Unknown Object (File)
Dec 22 2023, 4:38 AM
Unknown Object (File)
Sep 11 2023, 8:36 AM
Unknown Object (File)
Jul 19 2023, 7:26 PM
Unknown Object (File)
Jun 23 2023, 5:09 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