diff options
| author | Emīls Piņķis <emils@mullvad.net> | 2020-01-07 11:46:56 +0000 |
|---|---|---|
| committer | Emīls Piņķis <emils@mullvad.net> | 2020-01-07 11:46:56 +0000 |
| commit | c479171d81a77c835f41271addd226507ed4dea7 (patch) | |
| tree | 067df1e5098c61c7f8f9277632b957d4940d406d | |
| parent | 1bef4d245fbe310bd3d852d9b12c95031378dea3 (diff) | |
| parent | 6555c147c4ee7722a99f60c2c8d644f2b6c724ac (diff) | |
| download | mullvadvpn-c479171d81a77c835f41271addd226507ed4dea7.tar.xz mullvadvpn-c479171d81a77c835f41271addd226507ed4dea7.zip | |
Merge branch 'linux-dns-without-resolv.conf'
| -rw-r--r-- | CHANGELOG.md | 4 | ||||
| -rw-r--r-- | talpid-core/src/dns/linux/static_resolv_conf.rs | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 2efd06916b..5967fab80f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,10 @@ Line wrap the file at 100 chars. Th - Add translations for Finnish and Danish. ### Changed +#### Linux +- DNS management with static `/etc/resolv.conf` will now work even when no + `/etc/resolv.conf` exists. + #### Android - Wait for traffic to be routed through the tunnel device before advertising blocked state. diff --git a/talpid-core/src/dns/linux/static_resolv_conf.rs b/talpid-core/src/dns/linux/static_resolv_conf.rs index 70ff38ddce..1a867a079d 100644 --- a/talpid-core/src/dns/linux/static_resolv_conf.rs +++ b/talpid-core/src/dns/linux/static_resolv_conf.rs @@ -172,6 +172,10 @@ impl DnsWatcher { } fn read_config() -> Result<Config> { + if !std::path::Path::new(RESOLV_CONF_PATH).exists() { + return Ok(Config::new()); + } + let contents = fs::read_to_string(RESOLV_CONF_PATH) .map_err(|e| Error::ReadResolvConf(RESOLV_CONF_PATH, e))?; let config = Config::parse(&contents).map_err(|e| Error::ParseError(RESOLV_CONF_PATH, e))?; |
