Files
tsunagi/crates/tsunagi-wg-quic
Aleksandr Bogomiakov 32aa73721a Keep every active mesh reachable through a single internet exit
With several IPv4 aliases on a single TUN, the default route could select an address from a different mesh. The exit peer then rejected internet traffic as an invalid source. Concurrent cross-network exit selections could also clear each other in the running agent while SQLite kept one winner.

Serialize validated exit choices with network lifecycle and persist each choice before publishing it to the shared routing table. Replace the previous exit atomically and preserve it across allocation updates. Both mesh subnets keep their own routes. Only replies from the selected exit to the local address of its network qualify for the external-source exception.

Prefer the selected source on Linux and macOS default routes. Preserve physical transport paths and update split routes in place. On Windows reuse the Android packet translation to restore off-mesh TCP, UDP and ICMP replies to the original local socket. Existing databases, IPC commands and wire protocols remain compatible.

On macOS, formatting and strict workspace Clippy passed. The full locked workspace suite passed 577 tests with three ignored, after correcting a stale Windows script-test matcher. Three real agents covered switching, concurrent selection, offline isolation and restart. On Linux arm64, 88 focused tests and the privileged kernel routing/firewall test passed. The Android arm64 library built and linked. Wintun and privileged macOS utun were not exercised on live hosts.
2026-11-25 02:32:09 +02:00
..
2026-11-25 00:12:11 +02:00