fix(tun): remove Linux-only block that forced tun.stack to mixed

This commit is contained in:
Slinetrac
2025-11-12 00:08:17 +08:00
parent afb3842776
commit 645b92bc28

View File

@@ -2,8 +2,6 @@ use serde_yaml_ng::{Mapping, Value};
#[cfg(target_os = "macos")]
use crate::process::AsyncHandler;
#[cfg(target_os = "linux")]
use crate::{logging, utils::logging::Type};
macro_rules! revise {
($map: expr, $key: expr, $val: expr) => {
@@ -31,27 +29,6 @@ pub fn use_tun(mut config: Mapping, enable: bool) -> Mapping {
});
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");
logging!(
warn,
Type::Network,
"Warning: gVisor TUN stack detected on Linux; falling back to 'mixed' for compatibility"
);
}
}
// 读取DNS配置
let dns_key = Value::from("dns");
let dns_val = config.get(&dns_key);