Skip to content

Commit b6f8e07

Browse files
Merge branch 'fix-excess-opentun-calls'
2 parents ccaff30 + d8922e0 commit b6f8e07

File tree

1 file changed

+6
-1
lines changed
  • talpid-wireguard/src/wireguard_go

1 file changed

+6
-1
lines changed

talpid-wireguard/src/wireguard_go/mod.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -361,8 +361,13 @@ impl WgGoTunnel {
361361
tun_config.addresses = config.tunnel.addresses.clone();
362362
tun_config.ipv4_gateway = config.ipv4_gateway;
363363
tun_config.ipv6_gateway = config.ipv6_gateway;
364-
tun_config.routes = routes.collect();
365364
tun_config.mtu = config.mtu;
365+
tun_config.routes = if cfg!(target_os = "android") {
366+
// Route everything into the tunnel and have wireguard-go act as a firewall.
367+
vec!["0.0.0.0/0".parse().unwrap(), "::/0".parse().unwrap()]
368+
} else {
369+
routes.collect()
370+
};
366371

367372
for _ in 1..=MAX_PREPARE_TUN_ATTEMPTS {
368373
let tunnel_device = tun_provider

0 commit comments

Comments
 (0)