mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-09-02 17:15:43 +00:00
fix: return error instead of silently ignoring invalid dhcp_cidr in launcher
This commit is contained in:
@@ -638,10 +638,11 @@ impl NetworkConfig {
|
|||||||
cfg.set_hostname(self.hostname.clone());
|
cfg.set_hostname(self.hostname.clone());
|
||||||
cfg.set_dhcp(self.dhcp.unwrap_or_default());
|
cfg.set_dhcp(self.dhcp.unwrap_or_default());
|
||||||
if let Some(ref dhcp_cidr) = self.dhcp_cidr {
|
if let Some(ref dhcp_cidr) = self.dhcp_cidr {
|
||||||
if let Ok(cidr) = dhcp_cidr.parse::<cidr::Ipv4Cidr>() {
|
let cidr = dhcp_cidr.parse::<cidr::Ipv4Cidr>().with_context(|| {
|
||||||
|
format!("failed to parse dhcp_cidr: {}", dhcp_cidr)
|
||||||
|
})?;
|
||||||
cfg.set_dhcp_cidr(Some(cidr));
|
cfg.set_dhcp_cidr(Some(cidr));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
cfg.set_inst_name(self.network_name.clone().unwrap_or_default());
|
cfg.set_inst_name(self.network_name.clone().unwrap_or_default());
|
||||||
|
|
||||||
// The web UI does not expose credential inputs directly, but imported/saved
|
// The web UI does not expose credential inputs directly, but imported/saved
|
||||||
|
|||||||
Reference in New Issue
Block a user