fix(#883): warn + bail on unparseable subnet instead of silently writing empty LOCAL_ADDRESS; doc /0 corner case
This commit is contained in:
parent
ec8fcb29ce
commit
3c012efbea
1 changed files with 2 additions and 0 deletions
|
|
@ -101,6 +101,8 @@ pub fn agent_network_ip(name: &str, subnet_cidr: &str) -> Option<String> {
|
|||
let prefix_len: u32 = prefix_str.parse().ok()?;
|
||||
if prefix_len > 30 {
|
||||
// /31 and /32 have no room for agents; /30 has 1 usable slot.
|
||||
// /0 (the other extreme) is handled further down: host_count
|
||||
// overflows checked_shl(32) → 0 → usable = 0 → None.
|
||||
return None;
|
||||
}
|
||||
// Parse dotted-decimal IPv4.
|
||||
|
|
|
|||
Loading…
Reference in a new issue