Skip to content

Commit 8ed024f

Browse files
PR suggestions
1 parent 19cf6de commit 8ed024f

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

wicket/src/ui/panes/rack_setup.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,7 @@ fn rss_config_text<'a>(
715715
rack_network_config.as_ref().map_or("".into(), |c| {
716716
match c.rack_subnet_address {
717717
Some(v) => v.to_string(),
718-
None => "".to_string(),
718+
None => "(will be chosen randomly)".to_string(),
719719
}
720720
.into()
721721
}),

wicketd/src/rss_config.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,11 @@ pub fn validate_rack_subnet(
714714
return Err("rack number (seventh octet) cannot be 0".into());
715715
};
716716

717+
// Do not allow addresses more specific than /56
718+
if rack_subnet_address.octets()[7..].iter().any(|x| *x != 0x00) {
719+
return Err("rack subnet address is /56, but a more specific prefix was provided".into());
720+
};
721+
717722
Ipv6Net::new(rack_subnet_address, 56).map_err(|e| e.to_string())
718723
}
719724

0 commit comments

Comments
 (0)