mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-29 00:35:38 +08:00
fix: linux tun timeout (#4993)
* fix: linux tun timeout * docs: UPDATELOG.md
This commit is contained in:
@@ -22,6 +22,7 @@
|
|||||||
- 移除流媒体检测的系统级提示(使用软件内通知)
|
- 移除流媒体检测的系统级提示(使用软件内通知)
|
||||||
- 优化后端 i18n 资源占用
|
- 优化后端 i18n 资源占用
|
||||||
- 改进 Linux 托盘支持并添加 `--no-tray` 选项
|
- 改进 Linux 托盘支持并添加 `--no-tray` 选项
|
||||||
|
- Linux 现在在新生成的配置中默认将 TUN 栈恢复为 mixed 模式
|
||||||
|
|
||||||
### 🐞 修复问题
|
### 🐞 修复问题
|
||||||
|
|
||||||
|
|||||||
@@ -51,6 +51,9 @@ impl IClashTemp {
|
|||||||
let mut tun = Mapping::new();
|
let mut tun = Mapping::new();
|
||||||
let mut cors_map = Mapping::new();
|
let mut cors_map = Mapping::new();
|
||||||
tun.insert("enable".into(), false.into());
|
tun.insert("enable".into(), false.into());
|
||||||
|
#[cfg(target_os = "linux")]
|
||||||
|
tun.insert("stack".into(), "mixed".into());
|
||||||
|
#[cfg(not(target_os = "linux"))]
|
||||||
tun.insert("stack".into(), "gvisor".into());
|
tun.insert("stack".into(), "gvisor".into());
|
||||||
tun.insert("auto-route".into(), true.into());
|
tun.insert("auto-route".into(), true.into());
|
||||||
tun.insert("strict-route".into(), false.into());
|
tun.insert("strict-route".into(), false.into());
|
||||||
|
|||||||
@@ -29,6 +29,26 @@ pub fn use_tun(mut config: Mapping, enable: bool) -> Mapping {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if enable {
|
if enable {
|
||||||
|
#[cfg(target_os = "linux")]
|
||||||
|
{
|
||||||
|
let stack_key = Value::from("stack");
|
||||||
|
let should_override = match tun_val.get(&stack_key) {
|
||||||
|
Some(value) => value
|
||||||
|
.as_str()
|
||||||
|
.map(|stack| stack.eq_ignore_ascii_case("gvisor"))
|
||||||
|
.unwrap_or(false),
|
||||||
|
None => true,
|
||||||
|
};
|
||||||
|
|
||||||
|
if should_override {
|
||||||
|
revise!(tun_val, "stack", "mixed");
|
||||||
|
log::warn!(
|
||||||
|
target: "app",
|
||||||
|
"gVisor TUN stack detected on Linux; falling back to 'mixed' for compatibility"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 读取DNS配置
|
// 读取DNS配置
|
||||||
let dns_key = Value::from("dns");
|
let dns_key = Value::from("dns");
|
||||||
let dns_val = config.get(&dns_key);
|
let dns_val = config.get(&dns_key);
|
||||||
|
|||||||
Reference in New Issue
Block a user