diff --git a/talpid-core/src/tunnel_state_machine/connecting_state.rs b/talpid-core/src/tunnel_state_machine/connecting_state.rs index 2bfc83e55872..28731d617d6d 100644 --- a/talpid-core/src/tunnel_state_machine/connecting_state.rs +++ b/talpid-core/src/tunnel_state_machine/connecting_state.rs @@ -539,6 +539,12 @@ impl TunnelState for ConnectingState { retry_attempt: u32, ) -> (TunnelStateWrapper, TunnelStateTransition) { if shared_values.is_offline { + // FIXME: Temporary: Nudge route manager to update the default interface + #[cfg(target_os = "macos")] + if let Ok(handle) = shared_values.route_manager.handle() { + log::debug!("Poking route manager to update default routes"); + let _ = handle.refresh_routes(); + } return ErrorState::enter(shared_values, ErrorStateCause::IsOffline); } match shared_values.runtime.block_on( diff --git a/talpid-routing/src/unix/mod.rs b/talpid-routing/src/unix/mod.rs index 02dac8ac0fcd..863e3a3aac42 100644 --- a/talpid-routing/src/unix/mod.rs +++ b/talpid-routing/src/unix/mod.rs @@ -93,6 +93,14 @@ impl RouteManagerHandle { response_rx.await.map_err(|_| Error::ManagerChannelDown) } + /// Get current non-tunnel default routes. + #[cfg(target_os = "macos")] + pub fn refresh_routes(&self) -> Result<(), Error> { + self.tx + .unbounded_send(RouteManagerCommand::RefreshRoutes) + .map_err(|_| Error::RouteManagerDown) + } + /// Ensure that packets are routed using the correct tables. #[cfg(target_os = "linux")] pub async fn create_routing_rules(&self, enable_ipv6: bool) -> Result<(), Error> {