mirror of
https://github.com/2dust/v2rayN.git
synced 2025-05-15 20:58:07 +00:00
Fix tun mtu setting
This commit is contained in:
parent
555960e210
commit
98613c43ca
3 changed files with 8 additions and 8 deletions
|
@ -429,12 +429,12 @@ namespace ServiceLib
|
||||||
"fakedns+others"
|
"fakedns+others"
|
||||||
];
|
];
|
||||||
|
|
||||||
public static readonly List<string> TunMtus =
|
public static readonly List<int> TunMtus =
|
||||||
[
|
[
|
||||||
"1280",
|
1280,
|
||||||
"1408",
|
1408,
|
||||||
"1500",
|
1500,
|
||||||
"9000"
|
9000
|
||||||
];
|
];
|
||||||
|
|
||||||
public static readonly List<string> TunStacks =
|
public static readonly List<string> TunStacks =
|
||||||
|
|
|
@ -725,7 +725,7 @@ namespace ServiceLib.Handler
|
||||||
profileItem.Network = string.Empty;
|
profileItem.Network = string.Empty;
|
||||||
if (profileItem.ShortId.IsNullOrEmpty())
|
if (profileItem.ShortId.IsNullOrEmpty())
|
||||||
{
|
{
|
||||||
profileItem.ShortId = Global.TunMtus.FirstOrDefault();
|
profileItem.ShortId = Global.TunMtus.First().ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (profileItem.Id.IsNullOrEmpty())
|
if (profileItem.Id.IsNullOrEmpty())
|
||||||
|
|
|
@ -599,7 +599,7 @@ namespace ServiceLib.Services.CoreConfig
|
||||||
{
|
{
|
||||||
if (_config.TunModeItem.Mtu <= 0)
|
if (_config.TunModeItem.Mtu <= 0)
|
||||||
{
|
{
|
||||||
_config.TunModeItem.Mtu = Utils.ToInt(Global.TunMtus.First());
|
_config.TunModeItem.Mtu = Global.TunMtus.First();
|
||||||
}
|
}
|
||||||
if (Utils.IsNullOrEmpty(_config.TunModeItem.Stack))
|
if (Utils.IsNullOrEmpty(_config.TunModeItem.Stack))
|
||||||
{
|
{
|
||||||
|
@ -745,7 +745,7 @@ namespace ServiceLib.Services.CoreConfig
|
||||||
outbound.peer_public_key = node.PublicKey;
|
outbound.peer_public_key = node.PublicKey;
|
||||||
outbound.reserved = Utils.String2List(node.Path)?.Select(int.Parse).ToList();
|
outbound.reserved = Utils.String2List(node.Path)?.Select(int.Parse).ToList();
|
||||||
outbound.local_address = Utils.String2List(node.RequestHost);
|
outbound.local_address = Utils.String2List(node.RequestHost);
|
||||||
outbound.mtu = Utils.ToInt(node.ShortId.IsNullOrEmpty() ? Global.TunMtus.FirstOrDefault() : node.ShortId);
|
outbound.mtu = Utils.ToInt(node.ShortId.IsNullOrEmpty() ? Global.TunMtus.First() : node.ShortId);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue