diff options
| author | Emīls <emils@mullvad.net> | 2020-09-03 13:00:47 +0100 |
|---|---|---|
| committer | Emīls <emils@mullvad.net> | 2020-09-03 13:00:47 +0100 |
| commit | 6addedb334cdff7f12e8622648bcc8c27ca2fd4d (patch) | |
| tree | 28774a698e126d9d1c69d15df8d567ca308fd142 | |
| parent | 554be9cb5740847e0de244320bc9f11a534f951b (diff) | |
| parent | 64c1e89767fb0f7267d68c8e39e7b2d87d54edad (diff) | |
| download | mullvadvpn-6addedb334cdff7f12e8622648bcc8c27ca2fd4d.tar.xz mullvadvpn-6addedb334cdff7f12e8622648bcc8c27ca2fd4d.zip | |
Merge branch 'linux-fix-systemd-resolved'
| -rw-r--r-- | talpid-core/src/dns/linux/systemd_resolved.rs | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/talpid-core/src/dns/linux/systemd_resolved.rs b/talpid-core/src/dns/linux/systemd_resolved.rs index ee0ad7e793..1c0d2ae0fb 100644 --- a/talpid-core/src/dns/linux/systemd_resolved.rs +++ b/talpid-core/src/dns/linux/systemd_resolved.rs @@ -51,7 +51,9 @@ pub enum Error { lazy_static! { static ref RESOLVED_STUB_PATHS: Vec<&'static Path> = vec![ Path::new("/run/systemd/resolve/stub-resolv.conf"), + Path::new("/run/systemd/resolve/resolv.conf"), Path::new("/var/run/systemd/resolve/stub-resolv.conf"), + Path::new("/var/run/systemd/resolve/resolv.conf"), ]; } @@ -77,17 +79,25 @@ pub struct SystemdResolved { impl SystemdResolved { pub fn new() -> Result<Self> { - let dbus_connection = - dbus::Connection::get_private(BusType::System).map_err(Error::ConnectDBus)?; - let systemd_resolved = SystemdResolved { - dbus_connection, - interface_link: None, - }; + let result = (|| { + let dbus_connection = + dbus::Connection::get_private(BusType::System).map_err(Error::ConnectDBus)?; + let systemd_resolved = SystemdResolved { + dbus_connection, + interface_link: None, + }; - systemd_resolved.ensure_resolved_exists()?; - Self::ensure_resolv_conf_is_resolved_symlink()?; + systemd_resolved.ensure_resolved_exists()?; + Self::ensure_resolv_conf_is_resolved_symlink()?; + Ok(systemd_resolved) + })(); - Ok(systemd_resolved) + if let Err(err) = &result { + log::error!("systemd-resolved is not being used because: {}", err); + } + + + result } fn ensure_resolved_exists(&self) -> Result<()> { |
