summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDavid Lönnhager <david.l@mullvad.net>2025-08-15 17:08:02 +0200
committerDavid Lönnhager <david.l@mullvad.net>2025-08-18 10:51:35 +0200
commit64a6f6540d0d81ad84c5a4bfef850d47ab5b5342 (patch)
tree028601c8ef1456c9c6ddcb7e268af619cee8c87d
parentb54341bb66f5b31aa2a32b89661d9f91a9c11980 (diff)
downloadmullvadvpn-64a6f6540d0d81ad84c5a4bfef850d47ab5b5342.tar.xz
mullvadvpn-64a6f6540d0d81ad84c5a4bfef850d47ab5b5342.zip
Filter out relays without QUIC endpoint for selected IP version
-rw-r--r--mullvad-relay-selector/src/relay_selector/matcher.rs14
1 files changed, 13 insertions, 1 deletions
diff --git a/mullvad-relay-selector/src/relay_selector/matcher.rs b/mullvad-relay-selector/src/relay_selector/matcher.rs
index 52f0cc600a..f6bf70f494 100644
--- a/mullvad-relay-selector/src/relay_selector/matcher.rs
+++ b/mullvad-relay-selector/src/relay_selector/matcher.rs
@@ -145,7 +145,19 @@ fn filter_on_obfuscation(
)
}
// QUIC is only enabled on some relays
- ObfuscationQuery::Quic => relay.wireguard().is_some_and(|wg| wg.quic().is_some()),
+ ObfuscationQuery::Quic => relay.wireguard().is_some_and(|wg| {
+ if let Some(quic) = wg.quic() {
+ // Only include relay if it has addresses for the selected IP version
+ matches!(
+ (query.ip_version, quic.in_ipv4(), quic.in_ipv6()),
+ (Constraint::Only(IpVersion::V4), Some(_), _)
+ | (Constraint::Only(IpVersion::V6), _, Some(_))
+ | (Constraint::Any, _, _)
+ )
+ } else {
+ false
+ }
+ }),
// Other relays are compatible with this query
ObfuscationQuery::Off | ObfuscationQuery::Auto | ObfuscationQuery::Udp2tcp(_) => true,
}