summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLinus Färnstrand <linus@mullvad.net>2018-09-06 10:07:07 +0200
committerLinus Färnstrand <linus@mullvad.net>2018-09-06 10:07:07 +0200
commit0216e1ad4b4b0a4dd415e9e897e9fd279f740589 (patch)
tree65cc8c33d87bc19eb2e7f41da01bd91ad1586f25
parente23db8886e254bdf81ea8cec612bd8b825e03495 (diff)
downloadmullvadvpn-0216e1ad4b4b0a4dd415e9e897e9fd279f740589.tar.xz
mullvadvpn-0216e1ad4b4b0a4dd415e9e897e9fd279f740589.zip
Fix bug that ignored hostname in location constraint filter
-rw-r--r--mullvad-daemon/src/relays.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/mullvad-daemon/src/relays.rs b/mullvad-daemon/src/relays.rs
index fea9bd8340..ff49e97c6e 100644
--- a/mullvad-daemon/src/relays.rs
+++ b/mullvad-daemon/src/relays.rs
@@ -262,12 +262,11 @@ impl RelaySelector {
})
}
Constraint::Only(LocationConstraint::Hostname(ref country, ref city, ref hostname)) => {
- relay
- .location
- .as_ref()
- .map_or(relay.hostname == *hostname, |loc| {
- loc.country_code == *country && loc.city_code == *city
- })
+ relay.location.as_ref().map_or(false, |loc| {
+ loc.country_code == *country
+ && loc.city_code == *city
+ && relay.hostname == *hostname
+ })
}
};
if !matches_location {