diff options
| author | Emīls <emils@mullvad.net> | 2019-12-05 11:52:20 +0000 |
|---|---|---|
| committer | Emīls <emils@mullvad.net> | 2019-12-05 12:26:24 +0000 |
| commit | c392409d76c1ff33141f01489c0856969faa1f9d (patch) | |
| tree | 1e6e432a294e5a9037ac0f7cc5fabd8564808776 | |
| parent | 36a742fa4d530876022615c4374fcae0ff3d4cf8 (diff) | |
| download | mullvadvpn-c392409d76c1ff33141f01489c0856969faa1f9d.tar.xz mullvadvpn-c392409d76c1ff33141f01489c0856969faa1f9d.zip | |
Improve wireguard port selection
| -rw-r--r-- | CHANGELOG.md | 2 | ||||
| -rw-r--r-- | mullvad-daemon/src/relays.rs | 9 |
2 files changed, 11 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c1f88d8fb..67cb7679f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,8 @@ Line wrap the file at 100 chars. Th - Notifications shown when connecting to a server include its location. - Upgrade OpenVPN from 2.4.7 to 2.4.8. - Upgrade OpenSSL from 1.1.1c to 1.1.1d. +- When using WireGuard without specifying a specific relay port, port 53 will be used after 2 + failed connection attempts for 2 out of 4 each successive connection attempts #### Windows - Use a larger icon in notifications on Windows 10. diff --git a/mullvad-daemon/src/relays.rs b/mullvad-daemon/src/relays.rs index def5dd313c..677dcb6da1 100644 --- a/mullvad-daemon/src/relays.rs +++ b/mullvad-daemon/src/relays.rs @@ -285,6 +285,15 @@ impl RelaySelector { Constraint::Only(TunnelProtocol::Wireguard) => { relay_constraints.wireguard_constraints = original_constraints.wireguard_constraints; + // This ensures that if after the first 2 failed attempts the daemon does not + // conenct, then afterwards 2 of each 4 successive attempts will try to connect on + // port 53. + if retry_attempt > 2 + && retry_attempt % 4 < 2 + && relay_constraints.wireguard_constraints.port.is_any() + { + relay_constraints.wireguard_constraints.port = Constraint::Only(53); + } } } |
