Don't generate TUN config for sing-box on Linux

This commit is contained in:
Valeriy Manzhos 2026-04-09 18:45:02 +03:00
parent d5267d0b69
commit 1d653535ba
No known key found for this signature in database
GPG key ID: 6547CFC8E2EC3D90
4 changed files with 4 additions and 4 deletions

View file

@ -10,7 +10,7 @@ public partial class CoreConfigSingboxService
return JsonUtils.Serialize(_coreConfig); return JsonUtils.Serialize(_coreConfig);
} }
var fullConfigTemplateItem = context.IsTunEnabled ? fullConfigTemplate.TunConfig : fullConfigTemplate.Config; var fullConfigTemplateItem = (context.IsTunEnabled && !Utils.IsLinux()) ? fullConfigTemplate.TunConfig : fullConfigTemplate.Config;
if (fullConfigTemplateItem.IsNullOrEmpty()) if (fullConfigTemplateItem.IsNullOrEmpty())
{ {
return JsonUtils.Serialize(_coreConfig); return JsonUtils.Serialize(_coreConfig);

View file

@ -414,7 +414,7 @@ public partial class CoreConfigSingboxService
{ {
var item = context.RawDnsItem; var item = context.RawDnsItem;
var strDNS = string.Empty; var strDNS = string.Empty;
if (context.IsTunEnabled) if (context.IsTunEnabled && !Utils.IsLinux())
{ {
strDNS = string.IsNullOrEmpty(item?.TunDNS) ? EmbedUtils.GetEmbedText(Global.TunSingboxDNSFileName) : item?.TunDNS; strDNS = string.IsNullOrEmpty(item?.TunDNS) ? EmbedUtils.GetEmbedText(Global.TunSingboxDNSFileName) : item?.TunDNS;
} }

View file

@ -50,7 +50,7 @@ public partial class CoreConfigSingboxService
} }
} }
if (context.IsTunEnabled) if (context.IsTunEnabled && !Utils.IsLinux())
{ {
if (_config.TunModeItem.Mtu <= 0) if (_config.TunModeItem.Mtu <= 0)
{ {

View file

@ -24,7 +24,7 @@ public partial class CoreConfigSingboxService
strategy = directDnsStrategy strategy = directDnsStrategy
}; };
if (_config.TunModeItem.EnableTun) if (_config.TunModeItem.EnableTun && !Utils.IsLinux())
{ {
_coreConfig.route.auto_detect_interface = true; _coreConfig.route.auto_detect_interface = true;