diff options
| author | David Lönnhager <david.l@mullvad.net> | 2021-04-22 15:45:09 +0200 |
|---|---|---|
| committer | David Lönnhager <david.l@mullvad.net> | 2021-05-17 11:08:50 +0200 |
| commit | 727015d63363922ec79ec4a3dcb79a34656d9468 (patch) | |
| tree | 0eadd80432de54ed0035cfd5a0082138ad492766 /mullvad-daemon | |
| parent | af9f0236984d5e41b2517a3fd52c417290094c82 (diff) | |
| download | mullvadvpn-727015d63363922ec79ec4a3dcb79a34656d9468.tar.xz mullvadvpn-727015d63363922ec79ec4a3dcb79a34656d9468.zip | |
Add exit location field
Diffstat (limited to 'mullvad-daemon')
| -rw-r--r-- | mullvad-daemon/src/relays.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/mullvad-daemon/src/relays.rs b/mullvad-daemon/src/relays.rs index 54d664b640..5b60369ad6 100644 --- a/mullvad-daemon/src/relays.rs +++ b/mullvad-daemon/src/relays.rs @@ -310,7 +310,7 @@ impl RelaySelector { } Constraint::Only(TunnelType::Wireguard) => { relay_constraints.wireguard_constraints = - original_constraints.wireguard_constraints; + original_constraints.wireguard_constraints.clone(); // This ensures that if after the first 2 failed attempts the daemon does not // connect, then afterwards 2 of each 4 successive attempts will try to connect on // port 53. @@ -493,7 +493,7 @@ impl RelaySelector { relay.tunnels = RelayTunnels { wireguard: Self::matching_wireguard_tunnels( &relay.tunnels, - constraints.wireguard_constraints, + &constraints.wireguard_constraints, ), openvpn: Self::matching_openvpn_tunnels( &relay.tunnels, @@ -507,7 +507,7 @@ impl RelaySelector { relay.tunnels = RelayTunnels { wireguard: Self::matching_wireguard_tunnels( &relay.tunnels, - constraints.wireguard_constraints, + &constraints.wireguard_constraints, ), openvpn: vec![], }; @@ -580,7 +580,7 @@ impl RelaySelector { fn matching_wireguard_tunnels( tunnels: &RelayTunnels, - constraints: WireguardConstraints, + constraints: &WireguardConstraints, ) -> Vec<WireguardEndpointData> { tunnels .wireguard @@ -660,7 +660,7 @@ impl RelaySelector { .choose(&mut self.rng) .cloned() .and_then(|wg_tunnel| { - self.wg_data_to_endpoint(relay, wg_tunnel, constraints.wireguard_constraints) + self.wg_data_to_endpoint(relay, wg_tunnel, &constraints.wireguard_constraints) }) }; @@ -689,7 +689,7 @@ impl RelaySelector { &mut self, relay: &Relay, data: WireguardEndpointData, - constraints: WireguardConstraints, + constraints: &WireguardConstraints, ) -> Option<MullvadEndpoint> { let host = self.get_address_for_wireguard_relay(relay, constraints)?; let port = self.get_port_for_wireguard_relay(&data, constraints)?; @@ -709,7 +709,7 @@ impl RelaySelector { fn get_address_for_wireguard_relay( &mut self, relay: &Relay, - constraints: WireguardConstraints, + constraints: &WireguardConstraints, ) -> Option<IpAddr> { match constraints.ip_version { Constraint::Any | Constraint::Only(IpVersion::V4) => Some(relay.ipv4_addr_in.into()), @@ -720,7 +720,7 @@ impl RelaySelector { fn get_port_for_wireguard_relay( &mut self, data: &WireguardEndpointData, - constraints: WireguardConstraints, + constraints: &WireguardConstraints, ) -> Option<u16> { match constraints.port { Constraint::Any => { |
