From c37ad5f1567196db30f60df2c4839a00e6c2c886 Mon Sep 17 00:00:00 2001 From: DHR60 Date: Wed, 15 Apr 2026 20:55:57 +0800 Subject: [PATCH] Revert mtu list --- v2rayN/ServiceLib/Models/V2rayConfig.cs | 2 +- v2rayN/ServiceLib/Sample/SampleTunInbound | 4 +--- .../Services/CoreConfig/V2ray/V2rayInboundService.cs | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/v2rayN/ServiceLib/Models/V2rayConfig.cs b/v2rayN/ServiceLib/Models/V2rayConfig.cs index b7e70116..4f73e65e 100644 --- a/v2rayN/ServiceLib/Models/V2rayConfig.cs +++ b/v2rayN/ServiceLib/Models/V2rayConfig.cs @@ -78,7 +78,7 @@ public class Inboundsettings4Ray public string? name { get; set; } - public List? MTU { get; set; } + public int? MTU { get; set; } public List? gateway { get; set; } diff --git a/v2rayN/ServiceLib/Sample/SampleTunInbound b/v2rayN/ServiceLib/Sample/SampleTunInbound index 03467b3e..95cefbc1 100644 --- a/v2rayN/ServiceLib/Sample/SampleTunInbound +++ b/v2rayN/ServiceLib/Sample/SampleTunInbound @@ -3,9 +3,7 @@ "protocol": "tun", "settings": { "name": "xray_tun", - "MTU": [ - 9000 - ], + "MTU": 9000, "gateway": [ "172.18.0.1/30", "fdfe:dcba:9876::1/126" diff --git a/v2rayN/ServiceLib/Services/CoreConfig/V2ray/V2rayInboundService.cs b/v2rayN/ServiceLib/Services/CoreConfig/V2ray/V2rayInboundService.cs index 5c52fb13..4831b5bc 100644 --- a/v2rayN/ServiceLib/Services/CoreConfig/V2ray/V2rayInboundService.cs +++ b/v2rayN/ServiceLib/Services/CoreConfig/V2ray/V2rayInboundService.cs @@ -55,7 +55,7 @@ public partial class CoreConfigV2rayService } var tunInbound = JsonUtils.Deserialize(EmbedUtils.GetEmbedText(Global.V2raySampleTunInbound)) ?? new Inbounds4Ray { }; tunInbound.settings.name = Utils.IsMacOS() ? $"utun{new Random().Next(99)}" : "xray_tun"; - tunInbound.settings.MTU = [_config.TunModeItem.Mtu]; + tunInbound.settings.MTU = _config.TunModeItem.Mtu; if (_config.TunModeItem.EnableIPv6Address == false) { tunInbound.settings.gateway = ["172.18.0.1/30"];