mirror of
https://github.com/EasyTier/EasyTier.git
synced 2024-11-16 03:32:43 +08:00
set ipv6 mtu on windows
windows use different MTU for ipv4 / ipv6, we should set both.
This commit is contained in:
parent
0fbbea963f
commit
198c239399
|
@ -384,6 +384,10 @@ impl IfConfiguerTrait for WindowsIfConfiger {
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn set_mtu(&self, name: &str, mtu: u32) -> Result<(), Error> {
|
async fn set_mtu(&self, name: &str, mtu: u32) -> Result<(), Error> {
|
||||||
|
let _ = run_shell_cmd(
|
||||||
|
format!("netsh interface ipv6 set subinterface {} mtu={}", name, mtu).as_str(),
|
||||||
|
)
|
||||||
|
.await;
|
||||||
run_shell_cmd(
|
run_shell_cmd(
|
||||||
format!("netsh interface ipv4 set subinterface {} mtu={}", name, mtu).as_str(),
|
format!("netsh interface ipv4 set subinterface {} mtu={}", name, mtu).as_str(),
|
||||||
)
|
)
|
||||||
|
|
|
@ -262,7 +262,9 @@ pub fn checkreg(dev_name:&str) -> io::Result<()> {
|
||||||
// check if ProfileName contains "et"
|
// check if ProfileName contains "et"
|
||||||
match subkey.get_value::<String, _>("ProfileName") {
|
match subkey.get_value::<String, _>("ProfileName") {
|
||||||
Ok(profile_name) => {
|
Ok(profile_name) => {
|
||||||
if profile_name.contains("et_") || (!dev_name.is_empty() && dev_name == profile_name) {
|
if profile_name.contains("et_")
|
||||||
|
|| (!dev_name.is_empty() && dev_name == profile_name)
|
||||||
|
{
|
||||||
keys_to_delete.push(subkey_name);
|
keys_to_delete.push(subkey_name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -280,7 +282,9 @@ pub fn checkreg(dev_name:&str) -> io::Result<()> {
|
||||||
// check if ProfileName contains "et"
|
// check if ProfileName contains "et"
|
||||||
match subkey.get_value::<String, _>("Description") {
|
match subkey.get_value::<String, _>("Description") {
|
||||||
Ok(profile_name) => {
|
Ok(profile_name) => {
|
||||||
if profile_name.contains("et_") || (!dev_name.is_empty() && dev_name == profile_name) {
|
if profile_name.contains("et_")
|
||||||
|
|| (!dev_name.is_empty() && dev_name == profile_name)
|
||||||
|
{
|
||||||
keys_to_delete_unmanaged.push(subkey_name);
|
keys_to_delete_unmanaged.push(subkey_name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user