diff options
| author | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2019-06-04 06:31:05 -0300 |
|---|---|---|
| committer | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2019-06-04 06:31:05 -0300 |
| commit | 686e1573604f3410f545d105611c0ac78c5fc516 (patch) | |
| tree | 1091bcd1426d63f1f87526eed507df923e275e2d | |
| parent | d3e5e016fc6bdf96123dc332b23f393e4a70ce9e (diff) | |
| parent | f8f6338852d2f860497c94d37c9040d6b53377d7 (diff) | |
| download | mullvadvpn-686e1573604f3410f545d105611c0ac78c5fc516.tar.xz mullvadvpn-686e1573604f3410f545d105611c0ac78c5fc516.zip | |
Merge branch 'any-tunnel-constraint-selection'
| -rw-r--r-- | mullvad-daemon/src/relays.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/mullvad-daemon/src/relays.rs b/mullvad-daemon/src/relays.rs index b2a0b14387..81874e4367 100644 --- a/mullvad-daemon/src/relays.rs +++ b/mullvad-daemon/src/relays.rs @@ -494,6 +494,7 @@ impl RelaySelector { match constraints { // TODO: Handle Constraint::Any case by selecting from both openvpn and wireguard // tunnels once wireguard is mature enough + #[cfg(not(target_os = "android"))] Constraint::Only(TunnelConstraints::OpenVpn(_)) | Constraint::Any => relay .tunnels .openvpn @@ -508,6 +509,21 @@ impl RelaySelector { .and_then(|wg_tunnel| { self.wg_data_to_endpoint(relay.ipv4_addr_in.into(), wg_tunnel, wg_constraints) }), + #[cfg(target_os = "android")] + Constraint::Any => relay + .tunnels + .wireguard + .choose(&mut self.rng) + .cloned() + .and_then(|wg_tunnel| { + self.wg_data_to_endpoint( + relay.ipv4_addr_in.into(), + wg_tunnel, + &WireguardConstraints::default(), + ) + }), + #[cfg(target_os = "android")] + Constraint::Only(TunnelConstraints::OpenVpn(_)) => None, } } |
