From e0e84127289eaad83d5b65b4c13d69e97bbe5c27 Mon Sep 17 00:00:00 2001 From: MystiPanda Date: Thu, 18 Apr 2024 10:27:09 +0800 Subject: [PATCH] refactor: change default value of mtu --- src-tauri/src/config/clash.rs | 2 +- src/components/setting/mods/tun-viewer.tsx | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src-tauri/src/config/clash.rs b/src-tauri/src/config/clash.rs index 8e4f75c..d9ff5ce 100644 --- a/src-tauri/src/config/clash.rs +++ b/src-tauri/src/config/clash.rs @@ -38,7 +38,7 @@ impl IClashTemp { tun.insert("strict-route".into(), false.into()); tun.insert("auto-detect-interface".into(), true.into()); tun.insert("dns-hijack".into(), vec!["any:53"].into()); - tun.insert("mtu".into(), 9000.into()); + tun.insert("mtu".into(), 1500.into()); #[cfg(not(target_os = "windows"))] map.insert("redir-port".into(), 7895.into()); #[cfg(target_os = "linux")] diff --git a/src/components/setting/mods/tun-viewer.tsx b/src/components/setting/mods/tun-viewer.tsx index a5b9861..9720f32 100644 --- a/src/components/setting/mods/tun-viewer.tsx +++ b/src/components/setting/mods/tun-viewer.tsx @@ -27,7 +27,7 @@ export const TunViewer = forwardRef((props, ref) => { autoDetectInterface: true, dnsHijack: ["any:53"], strictRoute: false, - mtu: 9000, + mtu: 1500, }); useImperativeHandle(ref, () => ({ @@ -40,7 +40,7 @@ export const TunViewer = forwardRef((props, ref) => { autoDetectInterface: clash?.tun["auto-detect-interface"] ?? true, dnsHijack: clash?.tun["dns-hijack"] ?? ["any:53"], strictRoute: clash?.tun["strict-route"] ?? false, - mtu: clash?.tun.mtu ?? 9000, + mtu: clash?.tun.mtu ?? 1500, }); }, close: () => setOpen(false), @@ -88,7 +88,7 @@ export const TunViewer = forwardRef((props, ref) => { "auto-detect-interface": true, "dns-hijack": ["any:53"], "strict-route": false, - mtu: 9000, + mtu: 1500, }; setValues({ stack: "gvisor", @@ -97,7 +97,7 @@ export const TunViewer = forwardRef((props, ref) => { autoDetectInterface: true, dnsHijack: ["any:53"], strictRoute: false, - mtu: 9000, + mtu: 1500, }); await patchClash({ tun }); await mutateClash( @@ -208,7 +208,7 @@ export const TunViewer = forwardRef((props, ref) => { spellCheck="false" sx={{ width: 250 }} value={values.mtu} - placeholder="9000" + placeholder="1500" onChange={(e) => setValues((v) => ({ ...v,