Keep concurrent overlays working and select faster data carriers

A second subnet on macOS could send with the first utun alias. Reconcile and verify each owned subnet route with its actual source, retry partially applied plans and expose host errors to clients. On Windows verify the alias and prefix on the intended adapter. Do not restart underlay sockets when the only network change is a local overlay address.

Compare mutually enabled carriers using authenticated data probes while the incumbent carries traffic. The dialler coordinates a generation-scoped decision after a sustained median RTT improvement. Old peers retain ordered fallback. Local IPC moves to v24 to report data RTT and the physical path independently of control RTT. The mesh wire versions, keys and saved network settings stay compatible.

Validated formatting, workspace Clippy and the workspace test suite on macOS, including bidirectional dual-network traffic and a live TLS-to-QUIC switch on loopback. Added focused native CI tests for macOS and Windows. The elevated utun test requires administrative access unavailable on the development host.
This commit is contained in:
Aleksandr Bogomiakov committed 2026-11-24 23:55:55 +02:00
1 parent 8d107cf0e9
commit 27e29cf8a7
34 files changed
+1569 -253

No files matched your search

+1 -1
View File
@@ -78,7 +78,7 @@ fn colour_of(health: Health) -> [u8; 3] {
match health {
Health::Disconnected => DARK_RED,
Health::Connected => BLUE,
Health::RangeConflict => [0xd9, 0x91, 0x20],
Health::RangeConflict | Health::InterfaceError => [0xd9, 0x91, 0x20],
Health::ExitNode => GREEN,
}
}
+15
View File
@@ -22,6 +22,8 @@ pub(crate) enum Health {
Disconnected,
/// Connected, nothing out of the ordinary.
Connected,
/// The shared host interface could not apply its addresses or routes.
InterfaceError,
/// At least one configured network is blocked by an overlapping active range.
RangeConflict,
/// This device's traffic leaves through an exit node, and that works.
@@ -35,6 +37,9 @@ impl Health {
let Some(report) = report else {
return Self::Disconnected;
};
if report.overlay_config_error.is_some() {
return Self::InterfaceError;
}
if report
.networks
.iter()
@@ -65,6 +70,7 @@ impl Health {
match self {
Self::Disconnected => "tsunagi: not connected",
Self::Connected => "tsunagi: connected",
Self::InterfaceError => "tsunagi: overlay interface configuration failed",
Self::RangeConflict => "tsunagi: network range conflict; open to switch networks",
Self::ExitNode => "tsunagi: using an exit node",
}
@@ -118,6 +124,15 @@ mod tests {
}
}
#[test]
fn a_host_interface_error_is_visible_even_with_connected_peers() {
let mut status = report(vec![network(2, ExitReport::default())]);
status.overlay_config_error = Some("utun5: could not install subnet route".into());
assert_eq!(Health::of(Some(&status)), Health::InterfaceError);
status.overlay_config_error = None;
assert_eq!(Health::of(Some(&status)), Health::Connected);
}
#[test]
fn overlapping_networks_are_visible_even_while_other_peers_are_connected() {
let mut blocked = NetworkReport {