From a3806e0190f959cbd65f31b5f271d26c856171be Mon Sep 17 00:00:00 2001 From: "Sijie.Sun" Date: Wed, 27 Aug 2025 09:57:32 +0800 Subject: [PATCH] fix set ipv6 mtu may cause tun init error (#1300) --- easytier/src/common/ifcfg/win/luid.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/easytier/src/common/ifcfg/win/luid.rs b/easytier/src/common/ifcfg/win/luid.rs index 29af75c..bae2316 100644 --- a/easytier/src/common/ifcfg/win/luid.rs +++ b/easytier/src/common/ifcfg/win/luid.rs @@ -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(()) }