diff options
| -rw-r--r-- | mullvad-types/src/settings/mod.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/mullvad-types/src/settings/mod.rs b/mullvad-types/src/settings/mod.rs index 7e18f63c5a..b71280a7e9 100644 --- a/mullvad-types/src/settings/mod.rs +++ b/mullvad-types/src/settings/mod.rs @@ -139,6 +139,19 @@ impl TryFrom<&RelaySettings> for Recent { .ok_or("Location must be Constraint::Only")? .clone(); + if matches!( + entry, + LocationConstraint::Location(GeographicLocationConstraint::Hostname(..)) + ) && matches!( + location, + LocationConstraint::Location(GeographicLocationConstraint::Hostname(..)) + ) && entry == location + { + return Err( + "Multihop recent cannot have identical (country, city, host) triple.", + ); + } + Recent::Multihop { entry, exit: location, |
