Skip to content

fix(vpn): fail early if wintun.dll is not present #16707

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 28, 2025
Merged

Conversation

deansheather
Copy link
Member

Prevents the VPN startup from hanging for 5 minutes due to a startup backoff if wintun.dll cannot be loaded.

Because the wintun package doesn't expose an easy Load() error method for us, the only way for us to force it to load (without unwanted side effects) is through wintun.Version() which doesn't return an error message.

So, we call that function so the wintun package loads the DLL and configures the logging properly, then we try to load the DLL ourselves. LoadLibraryEx will not load the library multiple times and returns a reference to the existing library.

Closes coder/coder-desktop-windows#24

@deansheather deansheather requested a review from sreya February 27, 2025 02:46
@deansheather deansheather merged commit b23e05b into main Feb 28, 2025
32 checks passed
@deansheather deansheather deleted the dean/wintun-check branch February 28, 2025 04:20
@github-actions github-actions bot locked and limited conversation to collaborators Feb 28, 2025
@matifali
Copy link
Member

/cherry-pick release/2.20

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The TUN code in coder/coder should fail early if there is no wintun.dll
4 participants