added windows's cmd's creation_flag

This commit is contained in:
asxalex 2024-07-23 15:09:26 +08:00
parent 538dea12f8
commit 029fe4389f

View File

@ -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")