Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions crates/minimal/src/resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)),
};
Expand All @@ -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()
))
);
Expand All @@ -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}");
}
Expand Down
4 changes: 2 additions & 2 deletions crates/minimald/src/net/answerer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!(
Expand Down
2 changes: 1 addition & 1 deletion crates/minimald/src/net/dns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions crates/minimald/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)),
}
Expand Down Expand Up @@ -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!(
Expand Down
10 changes: 5 additions & 5 deletions crates/minimald/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
);
Expand Down Expand Up @@ -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}"
);
Expand Down
2 changes: 1 addition & 1 deletion crates/minimald/src/sessions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 8 additions & 8 deletions crates/switch/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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());
}
Expand Down
6 changes: 3 additions & 3 deletions crates/switch/src/loopback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
);
Expand Down Expand Up @@ -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))
);
}

Expand Down
2 changes: 1 addition & 1 deletion scripts/session-e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading