Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wicketd] Pass RSS a /56 rack subnet instead of a raw IP address (/128) #5668

Merged
merged 1 commit into from
Apr 30, 2024

Conversation

jgallagher
Copy link
Contributor

@jgallagher jgallagher commented Apr 30, 2024

I think this should fix #5665. I checked a4x2 and it has a /56, so I think #5665 is specific to RSS when it's been run via wicket. I'll try this on madrid once a TUF repo is built.

I opened #5669 for the fact that our types allow this mistake; e.g., I think both

pub rack_subnet: Ipv6Network,
and
pub rack_subnet: Option<IpNetwork>,
are incorrect in that they allow any network size, and both should probably be Ipv6Net<RACK_PREFIX> instead. Fixing that is not trivial because at least the former is serialized in the bootstore.

@jgallagher jgallagher modified the milestones: 9, 8 Apr 30, 2024
@@ -498,7 +503,7 @@ fn validate_rack_network_config(
// TODO Add more client side checks on `rack_network_config` contents?

Ok(bootstrap_agent_client::types::RackNetworkConfigV1 {
rack_subnet: RACK_SUBNET.into(),
rack_subnet: RACK_SUBNET.net(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching this.

The original code makes me really uncomfortable to be honest, I don't like the fact that there's a From impl here. (Feels like the opposite of misuse-resistant.) Is that something we can fix?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The specific From impl we were hitting here is not under our control (https://docs.rs/ipnetwork/0.20.0/ipnetwork/struct.Ipv6Network.html#impl-From%3CIpv6Addr%3E). I think I'd claim that #5669 would be the right fix (i.e., stop using Ipv6Network when we know there should be a specific prefix length).

@jgallagher
Copy link
Contributor Author

Tested on madrid; looks good:

root@oxz_switch1:~# omdb db rack list
ID                                   INITIALIZED TUF_BASE_URL RACK_SUBNET
45e3bc39-e5e9-40e3-adea-a3b9cf70aa73 true        -            fd00:1122:3344:100::/56

@jgallagher jgallagher merged commit 09627ea into main Apr 30, 2024
21 checks passed
@jgallagher jgallagher deleted the john/fix-rss-rack-subnet branch April 30, 2024 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect rack subnet after RSS?
3 participants