From e21d23d92e3d4d0c3e0912a2b43facb6e3070924 Mon Sep 17 00:00:00 2001 From: Akrm Al-Hakimi Date: Wed, 20 May 2026 21:52:17 -0400 Subject: [PATCH] fix: replace `futures::executor::block_on` with native await in `build_active_vpn_map` to avoid executor nesting panic --- nmrs/src/core/vpn.rs | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/nmrs/src/core/vpn.rs b/nmrs/src/core/vpn.rs index 28a1c6ab..cf2dd740 100644 --- a/nmrs/src/core/vpn.rs +++ b/nmrs/src/core/vpn.rs @@ -519,19 +519,23 @@ async fn build_active_vpn_map( .map(DeviceState::from) .unwrap_or(DeviceState::Other(0)); - let interface = ac_proxy + let interface = match ac_proxy .get_property::>("Devices") .await .ok() .and_then(|devs| devs.first().cloned()) - .and_then(|dev_path| { - futures::executor::block_on(async { - let dp = nm_proxy(conn, dev_path, "org.freedesktop.NetworkManager.Device") - .await - .ok()?; - dp.get_property::("Interface").await.ok() - }) - }); + { + Some(dev_path) => { + let dp = nm_proxy(conn, dev_path, "org.freedesktop.NetworkManager.Device") + .await + .ok(); + match dp { + Some(proxy) => proxy.get_property::("Interface").await.ok(), + None => None, + } + } + None => None, + }; map.insert(uuid, (state, interface, true)); }