set ipv6 mtu on windows

windows use different MTU for ipv4 / ipv6, we should set both.
This commit is contained in:
sijie.sun
2024-08-15 21:55:02 +08:00
committed by Sijie.Sun
parent 0fbbea963f
commit 198c239399
2 changed files with 12 additions and 4 deletions
+4
View File
@@ -384,6 +384,10 @@ impl IfConfiguerTrait for WindowsIfConfiger {
}
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(
format!("netsh interface ipv4 set subinterface {} mtu={}", name, mtu).as_str(),
)