minor fixes

This commit is contained in:
Greenback 2020-10-08 19:16:47 +01:00
parent deb4d27857
commit 39754b840d
3 changed files with 14 additions and 13 deletions

View File

@ -105,12 +105,12 @@ namespace Jellyfin.Networking.Configuration
public string UDPPortRange { get; set; } = string.Empty;
/// <summary>
/// Gets or sets a value indicating whether gets or sets IPV6 capability..
/// Gets or sets a value indicating whether IPV6 capability is enabled.
/// </summary>
public bool EnableIPV6 { get; set; } = false;
/// <summary>
/// Gets or sets a value indicating whether gets or sets IPV4 capability..
/// Gets or sets a value indicating whether IPV6 capability is enabled.
/// </summary>
public bool EnableIPV4 { get; set; } = true;

View File

@ -346,7 +346,7 @@ namespace Jellyfin.Networking.Manager
if (!IsIP4Enabled && source.AddressFamily == AddressFamily.InterNetwork)
{
_logger.LogWarning("IPv4 is disabled in JellyFin, but enabled in the OS. This may affect how the interface is selected.");
_logger.LogWarning("IPv4 is disabled in Jellyfin, but enabled in the OS. This may affect how the interface is selected.");
}
isExternal = !IsInLocalNetwork(source);
@ -872,28 +872,29 @@ namespace Jellyfin.Networking.Manager
private void InitialiseBind(NetworkConfiguration config)
{
string[] ba = config.LocalNetworkAddresses;
string[] lanAddresses = config.LocalNetworkAddresses;
// TODO: remove when bug fixed: https://github.com/jellyfin/jellyfin-web/issues/1334
if (ba.Length == 1 && ba[0].IndexOf(',', StringComparison.OrdinalIgnoreCase) != -1)
if (lanAddresses.Length == 1 && lanAddresses[0].IndexOf(',', StringComparison.OrdinalIgnoreCase) != -1)
{
ba = ba[0].Split(',');
lanAddresses = lanAddresses[0].Split(',');
}
// TODO: end fix.
// TODO: end fix.
// Add virtual machine interface names to the list of bind exclusions, so that they are auto-excluded.
if (config.IgnoreVirtualInterfaces)
{
var newList = ba.ToList();
var newList = lanAddresses.ToList();
newList.AddRange(config.VirtualInterfaceNames.Split(',').ToList());
ba = newList.ToArray();
lanAddresses = newList.ToArray();
}
// Read and parse bind addresses and exclusions, removing ones that don't exist.
_bindAddresses = CreateIPCollection(ba).Union(_interfaceAddresses);
_bindExclusions = CreateIPCollection(ba, true).Union(_interfaceAddresses);
_bindAddresses = CreateIPCollection(lanAddresses).Union(_interfaceAddresses);
_bindExclusions = CreateIPCollection(lanAddresses, true).Union(_interfaceAddresses);
_logger.LogInformation("Using bind addresses: {0}", _bindAddresses);
_logger.LogInformation("Using bind exclusions: {0}", _bindExclusions);
}
@ -923,7 +924,7 @@ namespace Jellyfin.Networking.Manager
// If no LAN addresses are specified - all private subnets are deemed to be the LAN
_usingPrivateAddresses = _lanSubnets.Count == 0;
// NOTE: The order of the commands in this statement matters.
// NOTE: The order of the commands in this statement matters, otherwise the lists won't initialise correctly.
if (_usingPrivateAddresses)
{
_logger.LogDebug("Using LAN interface addresses as user provided no LAN details.");

View File

@ -99,12 +99,12 @@ namespace MediaBrowser.Model.Configuration
public string UDPPortRange { get; set; } = string.Empty;
/// <summary>
/// Gets or sets a value indicating whether gets or sets IPV6 capability.
/// Gets or sets a value indicating whether IPV6 capability is enabled.
/// </summary>
public bool EnableIPV6 { get; set; } = false;
/// <summary>
/// Gets or sets a value indicating whether gets or sets IPV4 capability.
/// Gets or sets a value indicating whether IPV4 capability is enabled.
/// </summary>
public bool EnableIPV4 { get; set; } = true;