Skip to content
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

Fix WireGuard connection cleanup if start fails #1606

Merged
merged 1 commit into from Feb 3, 2020
Merged

Conversation

anjmao
Copy link
Contributor

@anjmao anjmao commented Jan 31, 2020

Sometimes connection Start could finish setup tunnel but if handshake wait timeout (on any other error) occurs it will not cleanup. Now Start always calls Stop on error which does needed cleanup logic.

Fixes #1499

cmd/di_desktop.go Show resolved Hide resolved
mobile/mysterium/wireguard_connection_setup.go Outdated Show resolved Hide resolved
services/wireguard/connection/connection.go Outdated Show resolved Hide resolved
services/wireguard/connection/connection.go Show resolved Hide resolved
services/wireguard/connection/dns.go Show resolved Hide resolved
@anjmao anjmao force-pushed the wg-conn-cleanup branch 3 times, most recently from 79b7ae8 to 26ba14c Compare January 31, 2020 12:59
@codecov-io
Copy link

codecov-io commented Jan 31, 2020

Codecov Report

Merging #1606 into master will increase coverage by 0.62%.
The diff coverage is 53.44%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1606      +/-   ##
==========================================
+ Coverage   47.78%   48.41%   +0.62%     
==========================================
  Files         288      291       +3     
  Lines       11478    11650     +172     
==========================================
+ Hits         5485     5640     +155     
+ Misses       5600     5598       -2     
- Partials      393      412      +19
Impacted Files Coverage Δ
services/wireguard/wireguard.go 80.2% <ø> (ø) ⬆️
services/wireguard/connection/handshake.go 0% <0%> (ø)
services/wireguard/connection/dns.go 0% <0%> (ø)
mobile/mysterium/entrypoint.go 0% <0%> (ø) ⬆️
mobile/mysterium/wireguard_connection_setup.go 39.18% <46.87%> (+39.18%) ⬆️
services/wireguard/connection/connection.go 66.9% <86.48%> (ø)
tequilapi/sse/sse.go 71.11% <0%> (-3.34%) ⬇️
core/discovery/discovery.go 65.54% <0%> (-0.85%) ⬇️
core/connection/manager.go 82.74% <0%> (-0.64%) ⬇️
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 90a7d48...b6393fc. Read the comment docs.

e2e/connection_test.go Outdated Show resolved Hide resolved
Sometimes connection Start could finish setup tunnel but if
handshake wait timeout occurs it will not cleanup. Now Start always calls Stop
on error which does needed cleanup logic.
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.

Wireguard does not cleanup when connection fails
4 participants