The Free Software Media System - Server Backend & API
Declare VirtualInterfaceNames as string array for consistency
Shadowghostbd9a940fed12
diff --git a/Jellyfin.Networking/Configuration/NetworkConfiguration.cs b/Jellyfin.Networking/Configuration/NetworkConfiguration.csindex 642af7dda0..f904198510 100644--- a/Jellyfin.Networking/Configuration/NetworkConfiguration.cs+++ b/Jellyfin.Networking/Configuration/NetworkConfiguration.cs@@ -150,7 +150,7 @@ namespace Jellyfin.Networking.Configuration/// <summary>/// Gets or sets a value indicating the interface name prefixes that should be ignored. The list can be comma separated and values are case-insensitive. <seealso cref="IgnoreVirtualInterfaces"/>./// </summary>- public string VirtualInterfaceNames { get; set; } = "veth";+ public string[] VirtualInterfaceNames { get; set; } = new string[] { "veth" };/// <summary>/// Gets or sets a value indicating whether the published server uri is based on information in HTTP requests.diff --git a/Jellyfin.Networking/Manager/NetworkManager.cs b/Jellyfin.Networking/Manager/NetworkManager.csindex 0f8f1a36a0..146340989b 100644--- a/Jellyfin.Networking/Manager/NetworkManager.cs+++ b/Jellyfin.Networking/Manager/NetworkManager.cs@@ -359,12 +359,11 @@ namespace Jellyfin.Networking.Manager{// Remove potentially exisiting * and split config string into prefixesvar virtualInterfacePrefixes = config.VirtualInterfaceNames- .Replace("*", string.Empty, StringComparison.OrdinalIgnoreCase)- .ToLowerInvariant()- .Split(',');+ .Select(i => i.ToLowerInvariant()+ .Replace("*", string.Empty, StringComparison.OrdinalIgnoreCase));// Check all interfaces for matches against the prefixes and remove them- if (_interfaces.Count > 0 && virtualInterfacePrefixes.Length > 0)+ if (_interfaces.Count > 0 && virtualInterfacePrefixes.Any()){foreach (var virtualInterfacePrefix in virtualInterfacePrefixes){@@ -726,7 +725,15 @@ namespace Jellyfin.Networking.Managerif (MatchesPublishedServerUrl(source, isExternal, out string res, out port)){- _logger.LogInformation("{Source}: Using BindAddress {Address}:{Port}", source, res, port);+ if (port != null)+ {+ _logger.LogInformation("{Source}: Using BindAddress {Address}:{Port}", source, res, port);+ }+ else+ {+ _logger.LogInformation("{Source}: Using BindAddress {Address}", source, res);+ }+return res;}@@ -756,7 +763,7 @@ namespace Jellyfin.Networking.Managerif (intf.Address.Equals(source)){result = NetworkExtensions.FormatIpString(intf.Address);- _logger.LogDebug("{Source}: GetBindInterface: Has found matching interface. {Result}", source, result);+ _logger.LogDebug("{Source}: GetBindInterface: Has found matching interface: {Result}", source, result);return result;}}@@ -768,14 +775,14 @@ namespace Jellyfin.Networking.Managerif (intf.Subnet.Contains(source)){result = NetworkExtensions.FormatIpString(intf.Address);- _logger.LogDebug("{Source}: GetBindInterface: Has source, matched best internal interface on range. {Result}", source, result);+ _logger.LogDebug("{Source}: GetBindInterface: Has source, matched best internal interface on range: {Result}", source, result);return result;}}}result = NetworkExtensions.FormatIpString(availableInterfaces.First().Address);- _logger.LogDebug("{Source}: GetBindInterface: Matched first internal interface. {Result}", source, result);+ _logger.LogDebug("{Source}: GetBindInterface: Matched first internal interface: {Result}", source, result);return result;}@@ -956,7 +963,7 @@ namespace Jellyfin.Networking.Managerif (bindAddress != null){result = NetworkExtensions.FormatIpString(bindAddress);- _logger.LogDebug("{Source}: GetBindInterface: Has source, found a matching external bind interface. {Result}", source, result);+ _logger.LogDebug("{Source}: GetBindInterface: Has source, found a matching external bind interface: {Result}", source, result);return true;}}@@ -976,7 +983,7 @@ namespace Jellyfin.Networking.Managerif (bindAddress != null){result = NetworkExtensions.FormatIpString(bindAddress);- _logger.LogWarning("{Source}: Request received, matching internal interface bind found. {Result}", source, result);+ _logger.LogWarning("{Source}: Request received, matching internal interface bind found: {Result}", source, result);return true;}}@@ -1006,7 +1013,7 @@ namespace Jellyfin.Networking.Managerif (!IsInLocalNetwork(intf.Address) && intf.Subnet.Contains(source)){result = NetworkExtensions.FormatIpString(intf.Address);- _logger.LogDebug("{Source}: GetBindInterface: Selected best external on interface on range. {Result}", source, result);+ _logger.LogDebug("{Source}: GetBindInterface: Selected best external on interface on range: {Result}", source, result);return true;}}@@ -1014,7 +1021,7 @@ namespace Jellyfin.Networking.Managerif (hasResult != null){result = NetworkExtensions.FormatIpString(hasResult);- _logger.LogDebug("{Source}: GetBindInterface: Selected first external interface. {Result}", source, result);+ _logger.LogDebug("{Source}: GetBindInterface: Selected first external interface: {Result}", source, result);return true;}diff --git a/Jellyfin.Server/Migrations/PreStartupRoutines/CreateNetworkConfiguration.cs b/Jellyfin.Server/Migrations/PreStartupRoutines/CreateNetworkConfiguration.csindex b670172814..2c2715526f 100644--- a/Jellyfin.Server/Migrations/PreStartupRoutines/CreateNetworkConfiguration.cs+++ b/Jellyfin.Server/Migrations/PreStartupRoutines/CreateNetworkConfiguration.cs@@ -114,7 +114,7 @@ public class CreateNetworkConfiguration : IMigrationRoutinepublic bool IgnoreVirtualInterfaces { get; set; } = true;- public string VirtualInterfaceNames { get; set; } = "veth";+ public string[] VirtualInterfaceNames { get; set; } = new string[] { "veth" };public string[] PublishedServerUriBySubnet { get; set; } = Array.Empty<string>();