Allocate a /29 network instead of /30 to work around bootpd bug (#214)

This commit is contained in:
edi-oai
2026-10-09 16:15:19 +01:00
committed by GitHub
parent e1ecab195b
commit 27fe8a8567
3 changed files with 7 additions and 7 deletions
+2 -2
View File
@@ -42,8 +42,8 @@ impl Host {
vm_mac: EthernetAddress,
enable_isolation: bool,
) -> Result<Host> {
// Find an unused /30 subnet for the gateway and VM
let (gateway_ip, vm_ip, subnet) = subnet_finder::find_available_subnet(30)?;
// Find an unused /29 subnet for the gateway and VM
let (gateway_ip, vm_ip, subnet) = subnet_finder::find_available_subnet(29)?;
// Create vmnet's network configuration
let mut configuration = NetworkConfiguration::new(match vm_net_type {
+4 -4
View File
@@ -76,11 +76,11 @@ mod tests {
#[serial_test::serial]
fn finds_two_usable_addresses() {
// Find a subnet on the current host
let (gateway_ip, vm_ip, subnet) = find_available_subnet(30).unwrap();
let (gateway_ip, vm_ip, subnet) = find_available_subnet(29).unwrap();
// Check the subnet and its two usable addresses
assert_eq!(subnet.prefix_len(), 30);
// Check the subnet and its first two usable addresses
assert_eq!(subnet.prefix_len(), 29);
assert!(subnet.network().is_private());
assert_eq!(subnet.hosts().collect::<Vec<_>>(), [gateway_ip, vm_ip]);
assert_eq!(subnet.hosts().collect::<Vec<_>>()[..2], [gateway_ip, vm_ip]);
}
}