Skip to content

Commit

Permalink
Make sure that OpenVPN relays can not be selected on Android
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkusPettersson98 committed Mar 20, 2024
1 parent 81a3143 commit a2a3ea8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mullvad-relay-selector/src/relay_selector/matcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<TunnelType>, 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),
},
Expand Down

0 comments on commit a2a3ea8

Please sign in to comment.