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

VPN now recovers from WireGuard closing utun #3084

Merged
merged 9 commits into from
Aug 13, 2024

Conversation

diegoreymendez
Copy link
Contributor

@diegoreymendez diegoreymendez commented Aug 7, 2024

Task/Issue URL: https://app.asana.com/0/0/1208000338328853/f

iOS: duckduckgo/iOS#3204
BSK: duckduckgo/BrowserServicesKit#931

Description

If we detect an error while updating the tunnel configuration we now cancel the tunnel so Apple recreates the virtual interface.

I believe the underlying issue is WireGuard should not "touch" the virtual interface at all, as that responsibility is owned by Apple.

Testing

  1. Open Console.app and filter by category:Network Protection and by from adapter.
  2. Start the app
  3. Open youtube in a tab and make it run a video (I just found this makes the failure more likely to happen for some reason).
  4. Open DuckDuckGo in another tab, and search for "what is my ip"
  5. Once your IP comes up open the VPN status view in the DDG tab, and exclude the site from the VPN.
  6. Check if there's an error in console.app - the VPN should restart and you shouldn't notice any big interruption.
  7. If there was no error in console.app repease from step 5 but switching between include and exclude site.

Definition of Done:


Internal references:

Pull Request Review Checklist
Software Engineering Expectations
Technical Design Template
Pull Request Documentation

Copy link
Collaborator

@samsymons samsymons left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testing steps worked well for me, and a general smoke test of the VPN shows no issues on either macOS and iOS. Great find!

diegoreymendez added a commit to duckduckgo/BrowserServicesKit that referenced this pull request Aug 13, 2024
Task/Issue URL: https://app.asana.com/0/0/1208000338328853/f

iOS PR: duckduckgo/iOS#3204
macOS PR: duckduckgo/macos-browser#3084

What kind of version bump will this require?: Major

## Description

Adds a recovery mechanism for the tunnel so that when WireGuard throws
an error on tunnel update, we restart the VPN tunnel.
diegoreymendez added a commit to duckduckgo/iOS that referenced this pull request Aug 13, 2024
Task/Issue URL: https://app.asana.com/0/0/1208000338328853/f

macOS: duckduckgo/macos-browser#3084
BSK: duckduckgo/BrowserServicesKit#931

## Description

If we detect an error while updating the tunnel configuration we now
cancel the tunnel so Apple recreates the virtual interface.

I believe the underlying issue is WireGuard should not "touch" the
virtual interface at all, as that responsibility is owned by Apple.
@diegoreymendez diegoreymendez merged commit 3ed23a5 into main Aug 13, 2024
18 checks passed
@diegoreymendez diegoreymendez deleted the diego/fix-adapter-errors-on-update branch August 13, 2024 23:55
samsymons added a commit that referenced this pull request Aug 14, 2024
* main:
  VPN now recovers from WireGuard closing utun (#3084)
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.

2 participants