From 5a19819bfc775faf1f36325908b30da41d0e3350 Mon Sep 17 00:00:00 2001 From: bdbai Date: Sat, 20 Apr 2024 22:07:17 +0800 Subject: [PATCH] fix netif linux macos --- ytflow/src/plugin/netif/sys/apple/dns.rs | 7 +++++-- ytflow/src/plugin/netif/sys/linux/dns.rs | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ytflow/src/plugin/netif/sys/apple/dns.rs b/ytflow/src/plugin/netif/sys/apple/dns.rs index f57434a..4d1a9dc 100644 --- a/ytflow/src/plugin/netif/sys/apple/dns.rs +++ b/ytflow/src/plugin/netif/sys/apple/dns.rs @@ -213,8 +213,11 @@ mod tests { #[tokio::test] async fn test_lookup() { - let selector = - NetifSelector::new(SelectionMode::Manual("en0".into()), FamilyPreference::Both); + let selector = NetifSelector::new( + SelectionMode::Manual("en0".into()), + FamilyPreference::Both, + |_| None, + ); selector.cached_netif.store(Arc::new(Netif { name: "en0".into(), bsd_name: CString::from_vec_with_nul(b"en0\0"[..].into()).unwrap(), diff --git a/ytflow/src/plugin/netif/sys/linux/dns.rs b/ytflow/src/plugin/netif/sys/linux/dns.rs index 344902a..dde4cc6 100644 --- a/ytflow/src/plugin/netif/sys/linux/dns.rs +++ b/ytflow/src/plugin/netif/sys/linux/dns.rs @@ -209,6 +209,7 @@ mod tests { let selector = NetifSelector::new( SelectionMode::Manual("wlp3s0".into()), FamilyPreference::Both, + |_| None, ); selector.cached_netif.store(Arc::new(Netif { name: "wlp3s0".into(),