node & peer_mgr: fix rpc register/unregister

mut node
This commit is contained in:
Luna Yao committed 2026-04-28 21:23:16 +02:00
1 parent 8cf9d493b8
commit 46d1c2aef3
5 files changed
+71 -75

No files matched your search

+5 -3
View File
@@ -931,12 +931,14 @@ impl Instance {
#[cfg(feature = "magic-dns")]
{
self.dns = Some(DnsNode::new(
let mut node = DnsNode::new(
self.get_peer_manager(),
self.get_global_ctx(),
#[cfg(feature = "tun")]
self.get_nic_ctx(),
));
);
node.start();
self.dns = Some(node);
}
if self.global_ctx.config.get_dhcp() {
@@ -1485,7 +1487,7 @@ impl Instance {
pub async fn clear_resources(&mut self) {
self.peer_manager.clear_resources().await;
#[cfg(feature = "magic-dns")]
if let Some(node) = self.dns.take() {
if let Some(mut node) = self.dns.take() {
let _ = node.stop().await;
}
#[cfg(feature = "tun")]