From 8627046deb7d194044472857c60ecc3ac9bfe77d Mon Sep 17 00:00:00 2001 From: lubeilin <1791778603@qq.com> Date: Tue, 12 Mar 2024 21:30:06 +0800 Subject: [PATCH] =?UTF-8?q?[mio]=20=E5=85=BC=E5=AE=B9mac?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vnt/src/tun_tap_device/mod.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vnt/src/tun_tap_device/mod.rs b/vnt/src/tun_tap_device/mod.rs index 100412a..e950563 100644 --- a/vnt/src/tun_tap_device/mod.rs +++ b/vnt/src/tun_tap_device/mod.rs @@ -5,11 +5,13 @@ use tun::device::IFace; use tun::Device; use crate::core::Config; - +#[cfg(any(target_os = "windows", target_os = "linux"))] const DEFAULT_TUN_NAME: &str = "vnt-tun"; +#[cfg(any(target_os = "windows", target_os = "linux"))] const DEFAULT_TAP_NAME: &str = "vnt-tap"; pub fn create_device(config: &Config) -> io::Result> { + #[cfg(any(target_os = "windows", target_os = "linux"))] let default_name: &str = if config.tap { DEFAULT_TAP_NAME } else {