fix(tun): set auto-redirect default to false to improve cross-distro compatibility #5845

Closes #5845
This commit is contained in:
Slinetrac
2025-12-17 16:20:06 +08:00
parent bcb8e831c5
commit b6af7b7440

View File

@@ -33,7 +33,7 @@ export function TunViewer({ ref }: { ref?: Ref<DialogRef> }) {
stack: "mixed",
device: OS === "macos" ? "utun1024" : "Mihomo",
autoRoute: true,
autoRedirect: OS === "linux",
autoRedirect: false,
autoDetectInterface: true,
dnsHijack: ["any:53"],
strictRoute: false,
@@ -44,7 +44,7 @@ export function TunViewer({ ref }: { ref?: Ref<DialogRef> }) {
open: () => {
setOpen(true);
const nextAutoRoute = clash?.tun["auto-route"] ?? true;
const rawAutoRedirect = clash?.tun["auto-redirect"] ?? true;
const rawAutoRedirect = clash?.tun["auto-redirect"] ?? false;
const computedAutoRedirect =
OS === "linux" ? (nextAutoRoute ? rawAutoRedirect : false) : false;
setValues({
@@ -118,7 +118,7 @@ export function TunViewer({ ref }: { ref?: Ref<DialogRef> }) {
"auto-route": true,
...(OS === "linux"
? {
"auto-redirect": true,
"auto-redirect": false,
}
: {}),
"auto-detect-interface": true,
@@ -130,7 +130,7 @@ export function TunViewer({ ref }: { ref?: Ref<DialogRef> }) {
stack: "gvisor",
device: OS === "macos" ? "utun1024" : "Mihomo",
autoRoute: true,
autoRedirect: OS === "linux" ? true : false,
autoRedirect: false,
autoDetectInterface: true,
dnsHijack: ["any:53"],
strictRoute: false,