diff --git a/v2rayN/ServiceLib/Global.cs b/v2rayN/ServiceLib/Global.cs index 2c3e44d0..55df7714 100644 --- a/v2rayN/ServiceLib/Global.cs +++ b/v2rayN/ServiceLib/Global.cs @@ -745,7 +745,7 @@ public class Global MozillaRootProvider, ]; - public static readonly IReadOnlyList TunIpv4Address = + public static readonly IReadOnlyList TunIPv4Address = [ "172.18.0.1/30", "172.31.0.1/30", @@ -759,7 +759,7 @@ public class Global // Prefixes must leave room for a peer address (max /126); the sing-box system // stack derives a gateway from the first prefix and rejects single-address prefixes. - public static readonly IReadOnlyList TunIpv6Address = + public static readonly IReadOnlyList TunIPv6Address = [ "fc00::172:18:0:1/126", "fc00::172:31:0:1/126", diff --git a/v2rayN/ServiceLib/Models/Configs/ConfigItems.cs b/v2rayN/ServiceLib/Models/Configs/ConfigItems.cs index a4d4ced3..4fbdbb0b 100644 --- a/v2rayN/ServiceLib/Models/Configs/ConfigItems.cs +++ b/v2rayN/ServiceLib/Models/Configs/ConfigItems.cs @@ -149,8 +149,8 @@ public class TunModeItem public string IcmpRouting { get; set; } public bool EnableLegacyProtect { get; set; } = true; public List? RouteExcludeAddress { get; set; } - public string Ipv4Address { get; set; } - public string Ipv6Address { get; set; } + public string IPv4Address { get; set; } + public string IPv6Address { get; set; } } [Serializable] diff --git a/v2rayN/ServiceLib/Services/CoreConfig/Singbox/SingboxInboundService.cs b/v2rayN/ServiceLib/Services/CoreConfig/Singbox/SingboxInboundService.cs index 5eb30ba4..bd4bcffd 100644 --- a/v2rayN/ServiceLib/Services/CoreConfig/Singbox/SingboxInboundService.cs +++ b/v2rayN/ServiceLib/Services/CoreConfig/Singbox/SingboxInboundService.cs @@ -68,11 +68,11 @@ public partial class CoreConfigSingboxService tunInbound.strict_route = _config.TunModeItem.StrictRoute; tunInbound.stack = _config.TunModeItem.Stack; - var address = _config.TunModeItem.Ipv4Address.NullIfEmpty() ?? Global.TunIpv4Address.First(); + var address = _config.TunModeItem.IPv4Address.NullIfEmpty() ?? Global.TunIPv4Address.First(); tunInbound.address = [address]; if (_config.TunModeItem.EnableIPv6Address == true) { - var address6 = _config.TunModeItem.Ipv6Address.NullIfEmpty() ?? Global.TunIpv6Address.First(); + var address6 = _config.TunModeItem.IPv6Address.NullIfEmpty() ?? Global.TunIPv6Address.First(); tunInbound.address.Add(address6); } tunInbound.route_exclude_address = _config.TunModeItem.RouteExcludeAddress; diff --git a/v2rayN/ServiceLib/Services/CoreConfig/V2ray/V2rayInboundService.cs b/v2rayN/ServiceLib/Services/CoreConfig/V2ray/V2rayInboundService.cs index c4891aaf..68e29531 100644 --- a/v2rayN/ServiceLib/Services/CoreConfig/V2ray/V2rayInboundService.cs +++ b/v2rayN/ServiceLib/Services/CoreConfig/V2ray/V2rayInboundService.cs @@ -64,11 +64,11 @@ public partial class CoreConfigV2rayService tunInbound.settings.name = context.IsMacOS ? $"utun{new Random().Next(99)}" : "xray_tun"; tunInbound.settings.MTU = _config.TunModeItem.Mtu; - var address = _config.TunModeItem.Ipv4Address.NullIfEmpty() ?? Global.TunIpv4Address.First(); + var address = _config.TunModeItem.IPv4Address.NullIfEmpty() ?? Global.TunIPv4Address.First(); tunInbound.settings.gateway = [address]; if (_config.TunModeItem.EnableIPv6Address == true) { - var address6 = _config.TunModeItem.Ipv6Address.NullIfEmpty() ?? Global.TunIpv6Address.First(); + var address6 = _config.TunModeItem.IPv6Address.NullIfEmpty() ?? Global.TunIPv6Address.First(); tunInbound.settings.gateway.Add(address6); } diff --git a/v2rayN/ServiceLib/ViewModels/OptionSettingViewModel.cs b/v2rayN/ServiceLib/ViewModels/OptionSettingViewModel.cs index 9c97e9d8..f4fb464a 100644 --- a/v2rayN/ServiceLib/ViewModels/OptionSettingViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/OptionSettingViewModel.cs @@ -95,8 +95,8 @@ public class OptionSettingViewModel : MyReactiveObject, ICloseable [Reactive] public string TunIcmpRouting { get; set; } [Reactive] public bool TunEnableLegacyProtect { get; set; } [Reactive] public string TunRouteExcludeAddress { get; set; } - [Reactive] public string TunIpv4Address { get; set; } - [Reactive] public string TunIpv6Address { get; set; } + [Reactive] public string TunIPv4Address { get; set; } + [Reactive] public string TunIPv6Address { get; set; } #endregion Tun mode @@ -216,8 +216,8 @@ public class OptionSettingViewModel : MyReactiveObject, ICloseable TunIcmpRouting = _config.TunModeItem.IcmpRouting; TunEnableLegacyProtect = _config.TunModeItem.EnableLegacyProtect; TunRouteExcludeAddress = Utils.List2String(_config.TunModeItem.RouteExcludeAddress, true); - TunIpv4Address = _config.TunModeItem.Ipv4Address; - TunIpv6Address = _config.TunModeItem.Ipv6Address; + TunIPv4Address = _config.TunModeItem.IPv4Address; + TunIPv6Address = _config.TunModeItem.IPv6Address; #endregion Tun mode @@ -382,8 +382,8 @@ public class OptionSettingViewModel : MyReactiveObject, ICloseable _config.TunModeItem.IcmpRouting = TunIcmpRouting; _config.TunModeItem.EnableLegacyProtect = TunEnableLegacyProtect; _config.TunModeItem.RouteExcludeAddress = Utils.String2List(TunRouteExcludeAddress); - _config.TunModeItem.Ipv4Address = TunIpv4Address; - _config.TunModeItem.Ipv6Address = TunIpv6Address; + _config.TunModeItem.IPv4Address = TunIPv4Address; + _config.TunModeItem.IPv6Address = TunIPv6Address; //coreType await SaveCoreType(); diff --git a/v2rayN/v2rayN.Desktop/Views/OptionSettingWindow.axaml.cs b/v2rayN/v2rayN.Desktop/Views/OptionSettingWindow.axaml.cs index e0b8b535..72efd4dc 100644 --- a/v2rayN/v2rayN.Desktop/Views/OptionSettingWindow.axaml.cs +++ b/v2rayN/v2rayN.Desktop/Views/OptionSettingWindow.axaml.cs @@ -33,8 +33,8 @@ public partial class OptionSettingWindow : WindowBase cmbMtu.ItemsSource = Global.TunMtus; cmbStack.ItemsSource = Global.TunStacks; cmbIcmpRoutingPolicy.ItemsSource = Global.TunIcmpRoutingPolicies; - cmbIpv4Address.ItemsSource = Global.TunIpv4Address; - cmbIpv6Address.ItemsSource = Global.TunIpv6Address; + cmbIpv4Address.ItemsSource = Global.TunIPv4Address; + cmbIpv6Address.ItemsSource = Global.TunIPv6Address; cmbFragmentPackets.ItemsSource = Global.FragmentPacketsOptions; cmbCoreType1.ItemsSource = Global.CoreTypes; @@ -131,8 +131,8 @@ public partial class OptionSettingWindow : WindowBase this.Bind(ViewModel, vm => vm.TunIcmpRouting, v => v.cmbIcmpRoutingPolicy.SelectedValue).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.TunEnableLegacyProtect, v => v.togEnableLegacyProtect.IsChecked).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.TunRouteExcludeAddress, v => v.txtRouteExcludeAddress.Text).DisposeWith(disposables); - this.Bind(ViewModel, vm => vm.TunIpv4Address, v => v.cmbIpv4Address.SelectedValue).DisposeWith(disposables); - this.Bind(ViewModel, vm => vm.TunIpv6Address, v => v.cmbIpv6Address.SelectedValue).DisposeWith(disposables); + this.Bind(ViewModel, vm => vm.TunIPv4Address, v => v.cmbIpv4Address.SelectedValue).DisposeWith(disposables); + this.Bind(ViewModel, vm => vm.TunIPv6Address, v => v.cmbIpv6Address.SelectedValue).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.CoreType1, v => v.cmbCoreType1.SelectedValue).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.CoreType2, v => v.cmbCoreType2.SelectedValue).DisposeWith(disposables); diff --git a/v2rayN/v2rayN/Views/OptionSettingWindow.xaml.cs b/v2rayN/v2rayN/Views/OptionSettingWindow.xaml.cs index fc7f85a8..1aca3561 100644 --- a/v2rayN/v2rayN/Views/OptionSettingWindow.xaml.cs +++ b/v2rayN/v2rayN/Views/OptionSettingWindow.xaml.cs @@ -29,8 +29,8 @@ public partial class OptionSettingWindow cmbMtu.ItemsSource = Global.TunMtus; cmbStack.ItemsSource = Global.TunStacks; cmbIcmpRoutingPolicy.ItemsSource = Global.TunIcmpRoutingPolicies; - cmbIpv4Address.ItemsSource = Global.TunIpv4Address; - cmbIpv6Address.ItemsSource = Global.TunIpv6Address; + cmbIpv4Address.ItemsSource = Global.TunIPv4Address; + cmbIpv6Address.ItemsSource = Global.TunIPv6Address; cmbFragmentPackets.ItemsSource = Global.FragmentPacketsOptions; cmbCoreType1.ItemsSource = Global.CoreTypes; @@ -126,8 +126,8 @@ public partial class OptionSettingWindow this.Bind(ViewModel, vm => vm.TunIcmpRouting, v => v.cmbIcmpRoutingPolicy.Text).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.TunEnableLegacyProtect, v => v.togEnableLegacyProtect.IsChecked).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.TunRouteExcludeAddress, v => v.txtRouteExcludeAddress.Text).DisposeWith(disposables); - this.Bind(ViewModel, vm => vm.TunIpv4Address, v => v.cmbIpv4Address.Text).DisposeWith(disposables); - this.Bind(ViewModel, vm => vm.TunIpv6Address, v => v.cmbIpv6Address.Text).DisposeWith(disposables); + this.Bind(ViewModel, vm => vm.TunIPv4Address, v => v.cmbIpv4Address.Text).DisposeWith(disposables); + this.Bind(ViewModel, vm => vm.TunIPv6Address, v => v.cmbIpv6Address.Text).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.CoreType1, v => v.cmbCoreType1.Text).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.CoreType2, v => v.cmbCoreType2.Text).DisposeWith(disposables);