Files
tsunagi/crates/tsunagi-android/Cargo.toml
T
Aleksandr Bogomiakov 972b98363d Restore the socket source address across Android mesh networks
Android VpnService routes can select the primary VPN address for traffic to a second subnet even when both aliases are installed. Keep a bounded binding at the local TUN boundary so the peer receives the source it owns in that network and the original Android socket receives the reply. Preserve native primary traffic, separate per-subnet capacity, handle fragmented IPv4 and quoted ICMP errors, and retain eligible bindings when VpnService replaces its descriptor.

Support TCP, UDP and ICMP echo. An ambiguous tuple retains its original binding. Explicitly bound traffic for other IPv4 protocols passes using the proper network address. Mesh authentication, address admission and wire formats stay unchanged.

Reproduced the wrong source on a disposable Android API 37 ARM64 emulator. After the fix, system ping and an unbound connected UDP socket both received replies across each real VPN subnet. Built both debug APKs and confirmed that only the instrumentation APK includes its helper. Eleven focused Rust checks cover reverse mapping, checksums, fragments, limits and reconfiguration.
2026-11-25 00:03:02 +02:00

47 lines
1.2 KiB
TOML

[package]
name = "tsunagi-android"
version = "1.0.1"
description = "Android VPN client and egui views for tsunagi."
edition.workspace = true
rust-version.workspace = true
license.workspace = true
repository.workspace = true
publish = false
[lib]
crate-type = ["cdylib", "rlib"]
[[example]]
name = "vpn_source_probe"
crate-type = ["cdylib"]
[dependencies]
tsunagi-runtime = { path = "../tsunagi-runtime", version = "1.0.1" }
tsunagi-ui = { path = "../tsunagi-ui" }
tsunagi-core = { path = "../tsunagi-core" }
tsunagi-wg-quic = { path = "../tsunagi-wg-quic" }
egui = "0.31"
egui-phosphor = "0.9"
tokio.workspace = true
bytes.workspace = true
zeroize = "1.9"
simple-dns = "0.12"
[target.'cfg(unix)'.dependencies]
rand = "0.10"
smoltcp = { version = "0.12", default-features = false, features = ["std", "medium-ip", "proto-ipv4", "socket-tcp", "socket-udp"] }
[target.'cfg(target_os = "android")'.dependencies]
egui_glow = { version = "0.31", default-features = false }
jni = "0.21"
iroh.workspace = true
jni-verifier = { package = "jni", version = "0.22" }
rustls-platform-verifier = "0.7"
[dev-dependencies]
tempfile.workspace = true
tsunagi-core = { path = "../tsunagi-core", features = ["testing"] }
[lints]
workspace = true