fix(companion): TUN reader no longer dies on non-blocking fd + VPN not metered
On-device diagnosis (phone on adb, 5G): mesh sessions established but no packet ever entered the tunnel — Android hands the VpnService TUN fd over non-blocking, and the fips fork's dedicated blocking-read thread treats EAGAIN as fatal, dying at startup. archy-fips-core now forces the fd into blocking mode before Node::start_with_tun_fd. Verified on-device: reader survives, packets flow into the mesh, and the 30s anchor-link flap is gone (stable 8+ min on 5G). Also setMetered(false): Android 10+ defaults VPNs to metered, flipping the phone into data-restricted behaviour whenever the mesh is up. Served APK: 0.5.4 (vc24). Handoff updated with the remaining node-side blocker: phone->anchor works, phone->node ULA gets no reply — needs fipsctl introspection on Framework PT (suspect fork/daemon session or routing mismatch). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -68,6 +68,14 @@ class ArchyVpnService : VpnService() {
|
||||
// And let apps that bind their own network skip the TUN
|
||||
// entirely — this is mesh reachability, not a privacy VPN.
|
||||
.allowBypass()
|
||||
.apply {
|
||||
// Android 10+ treats VPN networks as METERED by default,
|
||||
// which flips the whole phone into data-saver behaviour
|
||||
// (background sync off, "metered" warnings) while the
|
||||
// mesh is up. It inherits the underlying network's real
|
||||
// metered state instead.
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) setMetered(false)
|
||||
}
|
||||
.establish()
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, "VPN establish failed", e)
|
||||
|
||||
Reference in New Issue
Block a user