diff options
| author | Emīls <emils@mullvad.net> | 2022-01-21 16:07:15 +0000 |
|---|---|---|
| committer | Emīls <emils@mullvad.net> | 2022-01-24 16:08:38 +0000 |
| commit | bfadc62a8f724eabb35e703d0e8f02add1497d63 (patch) | |
| tree | 39f4dd719549515d85fa50cb5ebfe428159d2f22 /talpid-core/src | |
| parent | 0ea8846e777f96829572f380cd22eca4b358f89c (diff) | |
| download | mullvadvpn-bfadc62a8f724eabb35e703d0e8f02add1497d63.tar.xz mullvadvpn-bfadc62a8f724eabb35e703d0e8f02add1497d63.zip | |
Improve default route extraction
Diffstat (limited to 'talpid-core/src')
| -rw-r--r-- | talpid-core/src/routing/unix.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/talpid-core/src/routing/unix.rs b/talpid-core/src/routing/unix.rs index 73de23d378..ca04c8fd7a 100644 --- a/talpid-core/src/routing/unix.rs +++ b/talpid-core/src/routing/unix.rs @@ -272,7 +272,9 @@ impl Drop for RouteManager { #[cfg(target_os = "macos")] pub(crate) async fn get_default_routes() -> Result<(Option<super::Node>, Option<super::Node>), Error> { - let v4 = imp::RouteManagerImpl::get_default_node(IpVersion::V4).await?; - let v6 = imp::RouteManagerImpl::get_default_node(IpVersion::V6).await?; - Ok((v4, v6)) + use futures::TryFutureExt; + futures::try_join!( + imp::RouteManagerImpl::get_default_node(IpVersion::V4).map_err(Into::into), + imp::RouteManagerImpl::get_default_node(IpVersion::V6).map_err(Into::into) + ) } |
