From a2a3ea82da1e65e7c7737a80aeb88371857758f2 Mon Sep 17 00:00:00 2001 From: Markus Pettersson Date: Wed, 20 Mar 2024 14:43:58 +0100 Subject: [PATCH] Make sure that OpenVPN relays can not be selected on Android --- mullvad-relay-selector/src/relay_selector/matcher.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mullvad-relay-selector/src/relay_selector/matcher.rs b/mullvad-relay-selector/src/relay_selector/matcher.rs index e937b159390e..c287e30fe642 100644 --- a/mullvad-relay-selector/src/relay_selector/matcher.rs +++ b/mullvad-relay-selector/src/relay_selector/matcher.rs @@ -113,11 +113,13 @@ pub const fn filter_openvpn(relay: &Relay) -> bool { matches!(relay.endpoint_data, RelayEndpointData::Openvpn) } -/// Returns whether the relay is a Wireguard relay. +/// Returns whether the relay matches the tunnel constraint `filter` pub const fn filter_tunnel_type(filter: &Constraint, relay: &Relay) -> bool { match filter { Constraint::Any => true, Constraint::Only(typ) => match typ { + // Do not keep OpenVPN relays on Android + TunnelType::OpenVpn if cfg!(target_os = "android") => false, TunnelType::OpenVpn => filter_openvpn(relay), TunnelType::Wireguard => filter_wireguard(relay), },