removed parameter preset

pull/5416/head
BaronGreenback 4 years ago
parent a031f7e410
commit 2fe26ef136

@ -157,16 +157,15 @@ namespace Jellyfin.Networking.Manager
/// Creates a new network collection. /// Creates a new network collection.
/// </summary> /// </summary>
/// <param name="source">Items to assign the collection, or null.</param> /// <param name="source">Items to assign the collection, or null.</param>
/// <param name="unique"><c>True</c> if subnets that overlap should be merged (default).</param>
/// <returns>The collection created.</returns> /// <returns>The collection created.</returns>
public static Collection<IPObject> CreateCollection(IEnumerable<IPObject>? source = null, bool unique = true) public static Collection<IPObject> CreateCollection(IEnumerable<IPObject>? source = null)
{ {
var result = new Collection<IPObject>(); var result = new Collection<IPObject>();
if (source != null) if (source != null)
{ {
foreach (var item in source) foreach (var item in source)
{ {
result.AddItem(item, unique); result.AddItem(item, false);
} }
} }
@ -391,8 +390,7 @@ namespace Jellyfin.Networking.Manager
_interfaceAddresses _interfaceAddresses
.Exclude(_bindExclusions) .Exclude(_bindExclusions)
.Where(IsInLocalNetwork) .Where(IsInLocalNetwork)
.OrderBy(p => p.Tag), .OrderBy(p => p.Tag));
false);
if (interfaces.Count > 0) if (interfaces.Count > 0)
{ {
@ -432,11 +430,11 @@ namespace Jellyfin.Networking.Manager
if (_bindExclusions.Count > 0) if (_bindExclusions.Count > 0)
{ {
// Return all the internal interfaces except the ones excluded. // Return all the internal interfaces except the ones excluded.
return CreateCollection(_internalInterfaces.Where(p => !_bindExclusions.ContainsAddress(p)), false); return CreateCollection(_internalInterfaces.Where(p => !_bindExclusions.ContainsAddress(p)));
} }
// No bind address, so return all internal interfaces. // No bind address, so return all internal interfaces.
return CreateCollection(_internalInterfaces.Where(p => !p.IsLoopback()), false); return CreateCollection(_internalInterfaces.Where(p => !p.IsLoopback()));
} }
return new Collection<IPObject>(_bindAddresses); return new Collection<IPObject>(_bindAddresses);
@ -980,7 +978,7 @@ namespace Jellyfin.Networking.Manager
{ {
_logger.LogDebug("Using LAN interface addresses as user provided no LAN details."); _logger.LogDebug("Using LAN interface addresses as user provided no LAN details.");
// Internal interfaces must be private and not excluded. // Internal interfaces must be private and not excluded.
_internalInterfaces = CreateCollection(_interfaceAddresses.Where(i => IsPrivateAddressRange(i) && !_excludedSubnets.ContainsAddress(i)), false); _internalInterfaces = CreateCollection(_interfaceAddresses.Where(i => IsPrivateAddressRange(i) && !_excludedSubnets.ContainsAddress(i)));
// Subnets are the same as the calculated internal interface. // Subnets are the same as the calculated internal interface.
_lanSubnets = new Collection<IPObject>(); _lanSubnets = new Collection<IPObject>();
@ -1015,7 +1013,7 @@ namespace Jellyfin.Networking.Manager
} }
// Internal interfaces must be private, not excluded and part of the LocalNetworkSubnet. // Internal interfaces must be private, not excluded and part of the LocalNetworkSubnet.
_internalInterfaces = CreateCollection(_interfaceAddresses.Where(i => IsInLocalNetwork(i)), false); _internalInterfaces = CreateCollection(_interfaceAddresses.Where(i => IsInLocalNetwork(i)));
} }
_logger.LogInformation("Defined LAN addresses : {0}", _lanSubnets.AsString()); _logger.LogInformation("Defined LAN addresses : {0}", _lanSubnets.AsString());

Loading…
Cancel
Save