mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-11-29 00:00:37 +00:00
fix(windows): handle missing registry values during TUN name allocation (#2777)
* fix(windows): reuse TUN names with incomplete registry records A leftover Connection key must not force a new adapter identity after EasyTier has reserved the original name. Skip that identity before reading registry values and let rust-tun reopen or recreate the adapter. Keep conflict checks for other GUIDs: Wintun can otherwise rename an unrelated adapter that already uses the candidate name. Share the GUID calculation with VirtualNic so allocation and creation stay consistent. Verified on Windows 11 with concurrent processes, normal and forced exit, missing Name/PnpInstanceID values, and a different-GUID collision. The original reservation tests, Linux workspace Clippy, formatting, and Windows core checks pass. Co-authored-by: Daniel <2116528714@qq.com> --------- Co-authored-by: KKRainbow <5665404+KKRainbow@users.noreply.github.com>
This commit is contained in:
co-authored by
Daniel
KKRainbow
parent
c66076b8f3
commit
18f8e41fa1
@@ -581,10 +581,7 @@ impl VirtualNic {
|
||||
config.platform_config(|config| {
|
||||
// Wintun uses the GUID for Windows network profile identity.
|
||||
// Include the name so explicitly shared NICs use the same GUID.
|
||||
let identity = format!("https://easytier.rs/wintun/{}", dev_name.to_lowercase());
|
||||
config.device_guid(
|
||||
uuid::Uuid::new_v5(&uuid::Uuid::NAMESPACE_URL, identity.as_bytes()).as_u128(),
|
||||
);
|
||||
config.device_guid(crate::arch::windows::tun_device_guid(&dev_name).as_u128());
|
||||
config.skip_config(true);
|
||||
config.ring_cap(Some(std::cmp::min(
|
||||
config.min_ring_cap() * 32,
|
||||
|
||||
Reference in New Issue
Block a user