mirror of
https://github.com/EasyTier/EasyTier.git
synced 2025-09-26 20:51:17 +08:00
fix set ipv6 mtu may cause tun init error (#1300)
This commit is contained in:
@@ -701,8 +701,12 @@ impl InterfaceLuid {
|
||||
// SAFETY: Both NET_LUID_LH unions should be the same. We're just copying out
|
||||
// the u64 value and re-wrapping it, since wintun doesn't refer to the windows
|
||||
// crate's version of NET_LUID_LH.
|
||||
self.try_set_mtu(AF_INET as ADDRESS_FAMILY, mtu)?;
|
||||
self.try_set_mtu(AF_INET6 as ADDRESS_FAMILY, mtu)?;
|
||||
if let Err(e) = self.try_set_mtu(AF_INET as ADDRESS_FAMILY, mtu) {
|
||||
tracing::warn!("Failed to set IPv4 MTU: {:?}", e);
|
||||
}
|
||||
if let Err(e) = self.try_set_mtu(AF_INET6 as ADDRESS_FAMILY, mtu) {
|
||||
tracing::warn!("Failed to set IPv6 MTU: {:?}", e);
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user