diff options
| author | BaronGreenback <jimcartlidge@yahoo.co.uk> | 2021-02-23 17:06:40 +0000 |
|---|---|---|
| committer | BaronGreenback <jimcartlidge@yahoo.co.uk> | 2021-02-23 17:06:40 +0000 |
| commit | ff7cae8a13ce4bd5f158da840907a46ef2ad7d86 (patch) | |
| tree | 5c830cae7bb98c46ab396ac857b7c0cf0626a519 | |
| parent | 7bfc59b562b2a266e184d76c92a2af56377dfb5c (diff) | |
renamed method
| -rw-r--r-- | Jellyfin.Networking/Manager/NetworkManager.cs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Jellyfin.Networking/Manager/NetworkManager.cs b/Jellyfin.Networking/Manager/NetworkManager.cs index bd4b165b5..9cb49ce68 100644 --- a/Jellyfin.Networking/Manager/NetworkManager.cs +++ b/Jellyfin.Networking/Manager/NetworkManager.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Collections.ObjectModel; +using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Linq; using System.Net; @@ -693,7 +694,7 @@ namespace Jellyfin.Networking.Manager /// <param name="token">String to check.</param> /// <param name="index">Interface index numbers that match.</param> /// <returns><c>true</c> if an interface name matches the token, <c>False</c> otherwise.</returns> - private bool IsInterface(string token, out List<int>? index) + private bool TryIsInterface(string token, [NotNullWhen(true)] out List<int>? index) { index = null; @@ -734,14 +735,14 @@ namespace Jellyfin.Networking.Manager { // Is it the name of an interface (windows) eg, Wireless LAN adapter Wireless Network Connection 1. // Null check required here for automated testing. - if (IsInterface(token, out var index)) + if (TryIsInterface(token, out var index)) { _logger.LogInformation("Interface {Token} used in settings. Using its interface addresses.", token); // Replace all the interface tags with the interface IP's. foreach (IPNetAddress iface in _interfaceAddresses) { - if (index!.Contains(Math.Abs(iface.Tag)) + if (index.Contains(Math.Abs(iface.Tag)) && ((IsIP4Enabled && iface.Address.AddressFamily == AddressFamily.InterNetwork) || (IsIP6Enabled && iface.Address.AddressFamily == AddressFamily.InterNetworkV6))) { |
