diff options
| author | Linus Färnstrand <linus@mullvad.net> | 2018-09-06 10:07:07 +0200 |
|---|---|---|
| committer | Linus Färnstrand <linus@mullvad.net> | 2018-09-06 10:07:07 +0200 |
| commit | 0216e1ad4b4b0a4dd415e9e897e9fd279f740589 (patch) | |
| tree | 65cc8c33d87bc19eb2e7f41da01bd91ad1586f25 | |
| parent | e23db8886e254bdf81ea8cec612bd8b825e03495 (diff) | |
| download | mullvadvpn-0216e1ad4b4b0a4dd415e9e897e9fd279f740589.tar.xz mullvadvpn-0216e1ad4b4b0a4dd415e9e897e9fd279f740589.zip | |
Fix bug that ignored hostname in location constraint filter
| -rw-r--r-- | mullvad-daemon/src/relays.rs | 11 |
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 { |
