diff options
| -rw-r--r-- | talpid-wireguard/src/boringtun/mod.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/talpid-wireguard/src/boringtun/mod.rs b/talpid-wireguard/src/boringtun/mod.rs index ef3ce5116d..413a86dddd 100644 --- a/talpid-wireguard/src/boringtun/mod.rs +++ b/talpid-wireguard/src/boringtun/mod.rs @@ -219,7 +219,13 @@ pub async fn open_boringtun_tunnel( let mut tun_config = tun07::Configuration::default(); tun_config.raw_fd(fd); - let device = tun07::Device::new(&tun_config).unwrap(); + let mut device = tun07::Device::new(&tun_config).unwrap(); + + // HACK: the `tun` crate does not implement AbstractDevice::(set_)mtu on Android, instead + // they are stubbed. `mtu()` will simply return the value set by `set_mtu()`, or 1500. + // + // GotaTun will try to read the MTU from this, so call set_mtu here with the correct value. + device.set_mtu(config.mtu).unwrap(); (Arc::new(tun), tun07::AsyncDevice::new(device).unwrap()) }; |
