Skip to content

fix(windows): recover Wintun restarts on legacy Windows - #8

Merged
KKRainbow merged 1 commit into
v2from
fix/windows-legacy-wintun-restart
Oct 30, 2026
Merged

KKRainbow merged 1 commit into
v2from
fix/windows-legacy-wintun-restart

Conversation

@KKRainbow

@KKRainbow KKRainbow commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

On Windows 7, the first EasyTier start succeeds, but a subsequent start
can fail with Wintun adapter <name> has a different GUID. Wintun 0.14.1
does not retain the requested interface GUID on this OS, so the fixed-GUID
reopen check rejects the existing adapter.

Detect the real Windows version with RtlGetVersion and request a fixed
GUID only on Windows 10 and later. When an older system receives a GUID
request, create a fresh adapter without a requested GUID. This also avoids
reopening a device still owned by the previous process, which could later
be removed by Wintun's orphan cleanup. Callers without a GUID request
retain their existing reopen behavior. The modern Windows fixed-GUID
validation and recovery path stays unchanged.

The change uses the official Wintun DLL and accepts legacy Windows
network-profile numbering. It does not add adapter persistence or
network-profile cleanup.

Companion EasyTier PR: EasyTier/EasyTier#2780.

Validation

The same MSVC EasyTier executable was tested with the official
Wintun 0.14.1 DLL:

OS Normal Ctrl+C exit/start rounds Forced-termination/start rounds
Windows 7 SP1 x64 5/5 passed, exit code 0 5/5 passed
Windows 11 5/5 passed, exit code 0 5/5 passed

Each round verified TUN readiness, the expected IPv4 address, and a
connected interface with the core still running after five seconds.
No normal-exit round needed a fallback kill. Windows 11 retained the same
requested GUID throughout.

  • Rust formatting passed.
  • Windows-targeted library Clippy passed, with existing library warnings.
  • EasyTier full-workspace Clippy passed with all targets, full features,
    and warnings denied against this published Git revision.
  • Final read-only review of the complete change found no issues.

Windows 8/8.1 and cross-node data forwarding were not exercised.

Wintun 0.14.1 ignores requested interface GUIDs before Windows 10.
Reopening such an adapter therefore fails the fixed-GUID validation.
Skipping validation alone would reuse a device still owned by the old
process and expose the new session to Wintun's orphan cleanup.

Use RtlGetVersion to gate requested GUIDs to Windows 10 and later. When
a GUID was requested on an older system, create a fresh adapter without
one. Preserve the existing reopen behavior for callers without a GUID
and the fixed-GUID recovery path on modern Windows.

Keep the official Wintun DLL and accept legacy network-profile number
growth. Do not change adapter persistence or remove network profiles.

Validated the same MSVC EasyTier binary on Windows 7 SP1 and Windows 11
with the official Wintun 0.14.1 DLL. Each OS passed five normal exits
(exit code 0) and five forced-termination restart rounds, including IP
assignment and five seconds of active interface/session observation.
Windows 11 retained the requested GUID throughout. Windows-targeted
Clippy and formatting also passed; existing library warnings remain.
@KKRainbow
KKRainbow merged commit 43621f7 into v2 Oct 30, 2026
5 of 16 checks passed
KKRainbow added a commit to EasyTier/EasyTier that referenced this pull request Oct 30, 2026
Use rust-tun v2 commit 43621f7 after EasyTier/rust-tun#8 was squash
merged. Update both the manifest and lockfile from the feature-branch
revision to the merged revision.

The merged source tree matches tested a8ad3eb exactly. Reuse the
Windows 7/11 runtime results and full-workspace Clippy results.
Locked resolution of the merged dependency and formatting passed.
KKRainbow added a commit to EasyTier/EasyTier that referenced this pull request Oct 30, 2026
* fix(windows): update tun for legacy Windows restart recovery

Pin tun-easytier to a8ad3eb so legacy Windows creates a fresh Wintun
adapter instead of reopening one whose requested GUID was ignored.
This fixes the GUID mismatch on subsequent starts without changing
network-profile numbering or the modern Windows fixed-GUID behavior.

The dependency keeps the official Wintun DLL and preserves the existing
reopen path for callers that do not request a GUID.

Validated the resulting core on Windows 7 SP1 and Windows 11: each OS
passed five Ctrl+C exits and five forced-termination startup rounds,
with IP assignment and an active interface/session for five seconds.
Normal exits returned zero; Windows 11 kept its fixed GUID. Cross-node
data forwarding and Windows 8/8.1 were not exercised.

Formatting and full-workspace Clippy with all targets, full features,
and warnings denied passed against the published locked Git revision.

* fix(windows): pin merged Wintun restart fix

Use rust-tun v2 commit 43621f7 after EasyTier/rust-tun#8 was squash
merged. Update both the manifest and lockfile from the feature-branch
revision to the merged revision.

The merged source tree matches tested a8ad3eb exactly. Reuse the
Windows 7/11 runtime results and full-workspace Clippy results.
Locked resolution of the merged dependency and formatting passed.
zzxym pushed a commit to zzxym/rust-tun that referenced this pull request Nov 14, 2026
Wintun 0.14.1 ignores requested interface GUIDs before Windows 10.
Reopening such an adapter therefore fails the fixed-GUID validation.
Skipping validation alone would reuse a device still owned by the old
process and expose the new session to Wintun's orphan cleanup.

Use RtlGetVersion to gate requested GUIDs to Windows 10 and later. When
a GUID was requested on an older system, create a fresh adapter without
one. Preserve the existing reopen behavior for callers without a GUID
and the fixed-GUID recovery path on modern Windows.

Keep the official Wintun DLL and accept legacy network-profile number
growth. Do not change adapter persistence or remove network profiles.

Validated the same MSVC EasyTier binary on Windows 7 SP1 and Windows 11
with the official Wintun 0.14.1 DLL. Each OS passed five normal exits
(exit code 0) and five forced-termination restart rounds, including IP
assignment and five seconds of active interface/session observation.
Windows 11 retained the requested GUID throughout. Windows-targeted
Clippy and formatting also passed; existing library warnings remain.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant