From 0657b07c4ca151177412de49acbb146005490afd Mon Sep 17 00:00:00 2001 From: "minimal-foundry[bot]" <327719912+minimal-foundry[bot]@users.noreply.github.com> Date: Wed, 30 Sep 2026 03:17:49 +0000 Subject: [PATCH 1/2] fix(switch): move the reserved local range to 127.0.64.0/24 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The design (18-spec-box-networking §7.1) puts the reserved local range published addresses come from at 127.0.64.0/24; the constant carried 127.64.0.0/24, a different block of the same loopback /8. Move the definition and the default plan's slice tests to the design's block, and with them the bind-probe tests' literals, which name the range the same constant feeds. --- crates/switch/src/lib.rs | 16 ++++++++-------- crates/switch/src/loopback.rs | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/crates/switch/src/lib.rs b/crates/switch/src/lib.rs index 5fbf6f2509..19d004a5dd 100644 --- a/crates/switch/src/lib.rs +++ b/crates/switch/src/lib.rs @@ -39,7 +39,7 @@ pub const DEFAULT_SUBNET: SwitchSubnet = SwitchSubnet { }; /// The reserved local range published box addresses come from on the host's -/// loopback: `127.64.0.0/24` (design §7.1) — a loopback block no stock host +/// loopback: `127.0.64.0/24` (design §7.1) — a loopback block no stock host /// service claims, so a box published on the host answers there without /// colliding with the host's own `127.0.0.1` services. /// @@ -48,7 +48,7 @@ pub const DEFAULT_SUBNET: SwitchSubnet = SwitchSubnet { /// the plan below and the answerer cannot drift on where published /// addresses live: the range the plan publishes from is, by construction, /// the range the zone answers. -pub const RESERVED_LOCAL_RANGE: (Ipv4Addr, u8) = (Ipv4Addr::new(127, 64, 0, 0), 24); +pub const RESERVED_LOCAL_RANGE: (Ipv4Addr, u8) = (Ipv4Addr::new(127, 0, 64, 0), 24); /// Prefix of the reserved local range slice each switch (one gvproxy) publishes /// its boxes at. A /27 is 32 addresses — 32 published boxes per switch — and a @@ -797,7 +797,7 @@ mod tests { assert_eq!(plan.switch_subnet(), SwitchSubnet::default()); assert_eq!( plan.reserved_local_range(), - (Ipv4Addr::new(127, 64, 0, 0), 24) + (Ipv4Addr::new(127, 0, 64, 0), 24) ); // Box addresses self-allocated from the plan come from its switch // subnet, starting at the first allocatable host address — the same @@ -810,15 +810,15 @@ mod tests { // subnet — the host switch every VM's boxes ride on. let host = plan.switch_slice(0).unwrap(); assert_eq!(host.subnet(), SwitchSubnet::default()); - assert_eq!(host.loopback().first(), Ipv4Addr::new(127, 64, 0, 0)); - assert_eq!(host.loopback().last(), Ipv4Addr::new(127, 64, 0, 31)); - assert!(host.loopback().contains(Ipv4Addr::new(127, 64, 0, 16))); - assert_eq!(host.loopback().to_string(), "127.64.0.0-127.64.0.31"); + assert_eq!(host.loopback().first(), Ipv4Addr::new(127, 0, 64, 0)); + assert_eq!(host.loopback().last(), Ipv4Addr::new(127, 0, 64, 31)); + assert!(host.loopback().contains(Ipv4Addr::new(127, 0, 64, 16))); + assert_eq!(host.loopback().to_string(), "127.0.64.0-127.0.64.31"); // A second daemon on the same host self-allocates the next switch: a // /24 carved from the plan's subnet, with its own slice to publish at. let second = plan.switch_slice(1).unwrap(); assert_eq!(second.subnet().to_string(), "100.64.1.0/24"); - assert_eq!(second.loopback().first(), Ipv4Addr::new(127, 64, 0, 32)); + assert_eq!(second.loopback().first(), Ipv4Addr::new(127, 0, 64, 32)); // The plan runs out of switches exactly when it runs out of slices. assert!(plan.switch_slice(plan.switch_capacity()).is_none()); } diff --git a/crates/switch/src/loopback.rs b/crates/switch/src/loopback.rs index ebbee87790..2217546676 100644 --- a/crates/switch/src/loopback.rs +++ b/crates/switch/src/loopback.rs @@ -167,13 +167,13 @@ mod tests { assert_eq!( probe.first_failure, Some(( - Ipv4Addr::new(127, 64, 0, 1), + Ipv4Addr::new(127, 0, 64, 1), io::ErrorKind::AddrNotAvailable )), "the first missing alias is the one the summary names" ); assert!( - probe.summary().contains("first refusal 127.64.0.1"), + probe.summary().contains("first refusal 127.0.64.1"), "{}", probe.summary() ); @@ -210,7 +210,7 @@ mod tests { assert!(probe.interim()); assert_eq!( probe.first_failure.map(|(a, _)| a), - Some(Ipv4Addr::new(127, 64, 0, 100)) + Some(Ipv4Addr::new(127, 0, 64, 100)) ); } From cf37cee5930b136437766d0d4e3e909cc5e6b956 Mon Sep 17 00:00:00 2001 From: "minimal-foundry[bot]" <327719912+minimal-foundry[bot]@users.noreply.github.com> Date: Wed, 30 Sep 2026 03:32:18 +0000 Subject: [PATCH 2/2] test(minimald,minimal): follow the reserved local range's move Every reader of the moved range followed it to 127.0.64.0/24: the zone's and the slice-octet docs restated the block they re-export from the switch constant, the host-answerable tests and their outside cases now pin the /24's new boundary, the slice-log and session-start probe tests carry the new literals, the min CLI's naming-surface record and bundle probe record do too, and the session e2e's accepted-resolution pattern accepts the new block's addresses. No behavior changes here: the code already reads the one definition, which commit 1 moved. --- crates/minimal/src/resolver.rs | 6 +++--- crates/minimald/src/net/answerer.rs | 4 ++-- crates/minimald/src/net/dns.rs | 2 +- crates/minimald/src/rpc.rs | 4 ++-- crates/minimald/src/server.rs | 10 +++++----- crates/minimald/src/sessions.rs | 2 +- scripts/session-e2e.sh | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/crates/minimal/src/resolver.rs b/crates/minimal/src/resolver.rs index beaaf20209..464e852e90 100644 --- a/crates/minimal/src/resolver.rs +++ b/crates/minimal/src/resolver.rs @@ -1422,7 +1422,7 @@ mod tests { bound: 3, probed: 254, first_failure: Some(( - Ipv4Addr::new(127, 64, 0, 4), + Ipv4Addr::new(127, 0, 64, 4), std::io::ErrorKind::AddrNotAvailable, )), }; @@ -1432,7 +1432,7 @@ mod tests { assert_eq!( record.first_refusal, Some(( - "127.64.0.4".to_string(), + "127.0.64.4".to_string(), "address not available".to_string() )) ); @@ -1458,7 +1458,7 @@ mod tests { }; let json = serde_json_lenient::to_string_pretty(&surface).unwrap(); assert!(json.contains("\"zone\": \"min.internal\""), "{json}"); - assert!(json.contains("127.64.0.0/24"), "{json}"); + assert!(json.contains("127.0.64.0/24"), "{json}"); assert!(json.contains("\"interim_loopback\": false"), "{json}"); assert!(json.contains("\"port\": 15353"), "{json}"); } diff --git a/crates/minimald/src/net/answerer.rs b/crates/minimald/src/net/answerer.rs index bd7bb75aba..c27e98328c 100644 --- a/crates/minimald/src/net/answerer.rs +++ b/crates/minimald/src/net/answerer.rs @@ -901,11 +901,11 @@ mod tests { "127.0.0.1 answers" ); assert!( - is_host_answerable(Ipv4Addr::new(127, 64, 0, 1), &node), + is_host_answerable(Ipv4Addr::new(127, 0, 64, 1), &node), "the reserved local range answers" ); assert!( - !is_host_answerable(Ipv4Addr::new(127, 64, 1, 0), &node), + !is_host_answerable(Ipv4Addr::new(127, 0, 65, 0), &node), "the reserved range is a /24; past it, nothing answers" ); assert!( diff --git a/crates/minimald/src/net/dns.rs b/crates/minimald/src/net/dns.rs index cf1154a24f..718b5b3fea 100644 --- a/crates/minimald/src/net/dns.rs +++ b/crates/minimald/src/net/dns.rs @@ -77,7 +77,7 @@ pub const DEFAULT_HOST_ID: &str = "local"; const LOOPBACK: IpAddr = IpAddr::V4(Ipv4Addr::LOCALHOST); /// The reserved local range published box addresses come from on the host: -/// `127.64.0.0/24` (design §7.1), as network address and prefix. Loopback +/// `127.0.64.0/24` (design §7.1), as network address and prefix. Loopback /// space, so it never leaves the machine, with one address per published box /// (NET-010's host-global allocation). Kept as a pair rather than a CIDR type /// — the only question asked of it is membership, which diff --git a/crates/minimald/src/rpc.rs b/crates/minimald/src/rpc.rs index 518349a7e8..09891c7930 100644 --- a/crates/minimald/src/rpc.rs +++ b/crates/minimald/src/rpc.rs @@ -2797,7 +2797,7 @@ mod tests { bound: 0, probed: 254, first_failure: Some(( - std::net::Ipv4Addr::new(127, 64, 0, 1), + std::net::Ipv4Addr::new(127, 0, 64, 1), std::io::ErrorKind::AddrNotAvailable, )), } @@ -2886,7 +2886,7 @@ mod tests { let line = probe_line(&log.contents(), &created.id); assert!( - line.contains("127.64.0.0/24 254/254 bound"), + line.contains("127.0.64.0/24 254/254 bound"), "the probe covers the whole reserved range, and the line says so: {line}" ); assert!( diff --git a/crates/minimald/src/server.rs b/crates/minimald/src/server.rs index 429806a3a3..270c29cb2e 100644 --- a/crates/minimald/src/server.rs +++ b/crates/minimald/src/server.rs @@ -3367,16 +3367,16 @@ mod tests { assert_eq!( slice_a, ( - Ipv4Addr::new(127, 64, 0, 160), - Ipv4Addr::new(127, 64, 0, 191) + Ipv4Addr::new(127, 0, 64, 160), + Ipv4Addr::new(127, 0, 64, 191) ), "a daemon on 100.64.37.0/24 must draw from that /24's slice" ); assert_eq!( slice_b, ( - Ipv4Addr::new(127, 64, 0, 128), - Ipv4Addr::new(127, 64, 0, 159) + Ipv4Addr::new(127, 0, 64, 128), + Ipv4Addr::new(127, 0, 64, 159) ), "a daemon on 100.64.52.0/24 must draw from that /24's slice" ); @@ -3620,7 +3620,7 @@ mod tests { // switch, but it is still its own: the slice it draws from is keyed // on the octet, not the subnet (NET-027's address half). assert!( - line.contains("loopback_slice=127.64.0.160-127.64.0.191"), + line.contains("loopback_slice=127.0.64.160-127.0.64.191"), "a microVM daemon pinned to octet 37 draws from that octet's \ slice, not its switch's, got: {line}" ); diff --git a/crates/minimald/src/sessions.rs b/crates/minimald/src/sessions.rs index 6f7439048a..8f334de9a6 100644 --- a/crates/minimald/src/sessions.rs +++ b/crates/minimald/src/sessions.rs @@ -294,7 +294,7 @@ impl Manager { /// this daemon's published boxes come from. /// /// The range is host-global — every daemon on the machine draws from the -/// same `127.64.0.0/24` — so the slice a daemon draws from must be a +/// same `127.0.64.0/24` — so the slice a daemon draws from must be a /// function of **its own** identity (the same per-daemon identity that /// names its zone, NET-027), never a constant two daemons would both start /// at. That identity is the daemon's *slice octet*: the octet a deployment diff --git a/scripts/session-e2e.sh b/scripts/session-e2e.sh index 449a560dc0..50303b7318 100755 --- a/scripts/session-e2e.sh +++ b/scripts/session-e2e.sh @@ -3449,7 +3449,7 @@ proof_native_resolution_without_proxy_env() { fi echo "resolved $NATIVE_NAME.min.internal with no proxy settings: $native_resolved" case "$native_resolved" in - *127.0.0.1*|*127.64.0.*) ;; + *127.0.0.1*|*127.0.64.*) ;; *) echo "::error::the name resolved outside the box zone's loopback (got: '$native_resolved')" fail