From 79fa2a082363b4631f5dc2f759eb0569651740e9 Mon Sep 17 00:00:00 2001 From: lubeilin <1791778603@qq.com> Date: Sun, 19 Mar 2023 22:03:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E5=A4=9A=E4=BD=99=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- switch-desktop/src/main.rs | 1 + switch/Cargo.toml | 2 +- switch/src/tun_device/unix.rs | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/switch-desktop/src/main.rs b/switch-desktop/src/main.rs index 4fa2d65..3b66ab5 100644 --- a/switch-desktop/src/main.rs +++ b/switch-desktop/src/main.rs @@ -91,6 +91,7 @@ pub struct StartArgs { off_command_server: bool, /// 记录日志,输出在 home/.switch 目录下,长时间使用时不建议开启 /// Output the log in the "home/.switch" directory + #[arg(long)] log: bool, } diff --git a/switch/Cargo.toml b/switch/Cargo.toml index 1d760ef..9d70479 100644 --- a/switch/Cargo.toml +++ b/switch/Cargo.toml @@ -26,7 +26,7 @@ chrono = "0.4.23" #lazy_static = "1.4.0" #moka = "0.9.6" protobuf = "3.2.0" -local-ip-address = "0.4.9" +#local-ip-address = "0.4.9" #mio = {version = "0.8.6",features = ["os-poll", "net"]} #tokio = { version = "1.24.1", features = ["full"] } diff --git a/switch/src/tun_device/unix.rs b/switch/src/tun_device/unix.rs index 1d66659..28e5e79 100644 --- a/switch/src/tun_device/unix.rs +++ b/switch/src/tun_device/unix.rs @@ -68,7 +68,9 @@ impl TunWriter { return Err(io::Error::new(io::ErrorKind::Other, format!("{:?}", e))); } #[cfg(target_os = "macos")] - crate::tun_device::mac::config_ip(dev.name(), address, netmask, gateway); + if let Err(e) = crate::tun_device::mac::config_ip(dev.name(), address, netmask, gateway){ + log::error!("{}",e); + } return Ok(()); } }