From 8839b4b2f1018934f40af36576b464a740a4db50 Mon Sep 17 00:00:00 2001 From: KKRainbow <5665404+KKRainbow@users.noreply.github.com> Date: Thu, 15 Oct 2026 00:53:24 +0800 Subject: [PATCH] fix: avoid shared IPv4 miscompilation on Rust 1.95 (#2703) Keep ipv4_inet out of line to prevent LLVM load combining from zeroing the address and prefix when inlined into async add_ip. This works around Windows named-NIC IPv4 setup failures on the current release toolchain. Link the upstream LLVM fix so the workaround can be removed once all build toolchains include it. Fixes #2696 --- easytier/src/instance/shared_virtual_nic.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/easytier/src/instance/shared_virtual_nic.rs b/easytier/src/instance/shared_virtual_nic.rs index e732291e..444ba7f0 100644 --- a/easytier/src/instance/shared_virtual_nic.rs +++ b/easytier/src/instance/shared_virtual_nic.rs @@ -896,6 +896,10 @@ impl SharedVirtualNicRegistry { } } +// Rust 1.95's LLVM can zero this result when inlined into the async add_ip path. +// Remove this workaround once all build toolchains include LLVM's fix: +// https://github.com/llvm/llvm-project/pull/207229 +#[inline(never)] fn ipv4_inet(address: Ipv4Addr, prefix: i32) -> Result { let prefix = u8::try_from(prefix) .map_err(|_| anyhow::anyhow!("invalid IPv4 prefix length {}", prefix))?;