From 029fe4389f7bc2eb69ed1cb2b2db1ed53a57a44f Mon Sep 17 00:00:00 2001 From: asxalex Date: Tue, 23 Jul 2024 15:09:26 +0800 Subject: [PATCH] added windows's cmd's creation_flag --- src/network/tun_win.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/network/tun_win.rs b/src/network/tun_win.rs index be6c1e9..8b165e5 100644 --- a/src/network/tun_win.rs +++ b/src/network/tun_win.rs @@ -1,5 +1,6 @@ use sdlan_sn_rs::utils::{ip_to_string, net_bit_len_to_mask}; use std::io::{Error, ErrorKind}; +use std::os::windows::process::CommandExt; use std::process::Command; use std::sync::Arc; use wintun; @@ -53,6 +54,7 @@ impl Iface { let mut cmd = Command::new("netsh"); debug!("name={}, addr={}, mask={}", self.name, ip, netbit); let command = cmd + .creation_flags(0x08000000) .arg("interface") .arg("ip") .arg("set")