diff options
| -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)); + } } |
