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/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)) ); } 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