diff options
| author | Emīls Piņķis <emils@mullvad.net> | 2019-06-14 09:54:27 +0100 |
|---|---|---|
| committer | Emīls Piņķis <emils@mullvad.net> | 2019-06-14 15:04:03 +0100 |
| commit | b9381c5f60bef73a810453b74f643a0e55f3b447 (patch) | |
| tree | 7cf6d93e90cada64f6e3436a7882a5597b854c9d | |
| parent | aa2dfdfdd765680e6dbba9a7c7b70eaad797ae42 (diff) | |
| download | mullvadvpn-b9381c5f60bef73a810453b74f643a0e55f3b447.tar.xz mullvadvpn-b9381c5f60bef73a810453b74f643a0e55f3b447.zip | |
Let Linux offline check fail into an online state
| -rw-r--r-- | talpid-core/src/offline/linux.rs | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/talpid-core/src/offline/linux.rs b/talpid-core/src/offline/linux.rs index a5f35896a9..e387062d2d 100644 --- a/talpid-core/src/offline/linux.rs +++ b/talpid-core/src/offline/linux.rs @@ -189,11 +189,15 @@ fn monitor_event_loop( }) .map_err(|_| Error::MonitorNetlinkError); - connection + // Under normal circumstances, this runs forever. + let result = connection .map_err(Error::NetlinkError) .join(monitor) .wait() - .map(|_| ()) + .map(|_| ()); + // But if it fails, it should fail open. + link_monitor.reset(); + result } struct LinkMonitor { @@ -220,4 +224,9 @@ impl LinkMonitor { .unbounded_send(TunnelCommand::IsOffline(is_offline)); } } + + /// Allow the offline check to fail open. + fn reset(&mut self) { + let _ = self.sender.unbounded_send(TunnelCommand::IsOffline(false)); + } } |
