updated win's mtu
This commit is contained in:
parent
4aa33a4e26
commit
7e5792e190
@ -3,3 +3,6 @@ linker = "x86_64-linux-musl-gcc"
|
||||
|
||||
[target.aarch64-unknown-linux-gnu]
|
||||
linker = "aarch64-linux-gnu-gcc"
|
||||
|
||||
[target.x86_64-pc-windows-gnu]
|
||||
linker = "x86_64-w64-mingw32-gcc"
|
||||
|
||||
2
Makefile
2
Makefile
@ -12,7 +12,7 @@ linux-tun:
|
||||
RUSTFLAGS="-L ." cargo build --features "tun" --release
|
||||
|
||||
win:
|
||||
cargo build --release
|
||||
cargo build --release --target x86_64-pc-windows-gnu
|
||||
|
||||
pb:
|
||||
cargo run --bin build_pb
|
||||
|
||||
@ -91,6 +91,28 @@ impl Iface {
|
||||
error!("failed to run netsh: {}", e.to_string());
|
||||
}
|
||||
}
|
||||
|
||||
let mut cmd = Command::new("netsh");
|
||||
let command = cmd
|
||||
.creation_flags(0x08000000)
|
||||
.arg("interface")
|
||||
.arg("ipv4")
|
||||
.arg("set")
|
||||
.arg("subinterface")
|
||||
.arg(&format!("\"{}\"", self.name))
|
||||
.arg(format!("mtu={}", device_config.mtu))
|
||||
.arg("store=persistent");
|
||||
|
||||
let res = command.output();
|
||||
|
||||
match res {
|
||||
Ok(r) => {
|
||||
debug!("netsh2 ok: [{:?}]", String::from_utf8_lossy(&r.stdout));
|
||||
}
|
||||
Err(e) => {
|
||||
error!("failed to run netsh2: {}", e.to_string());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user