diff options
| author | gnattu <gnattu@users.noreply.github.com> | 2024-05-13 12:47:38 -0400 |
|---|---|---|
| committer | Joshua M. Boniface <joshua@boniface.me> | 2024-05-13 12:47:38 -0400 |
| commit | 69d4886697f3f5990069b6d7a8ca56d5a2ec111b (patch) | |
| tree | 5ebcad44be3c6e19fac93a5b5c555584fa5f39ee | |
| parent | 610e56baafc3011e1bfa043bdabb567bda0c2ab0 (diff) | |
Backport pull request #11587 from jellyfin/release-10.9.z
Fix network config
Original-merge: f396a95f05f965c40bddd4cd47a1aa1ccbafaff7
Merged-by: crobibero <cody@robibe.ro>
Backported-by: Joshua M. Boniface <joshua@boniface.me>
| -rw-r--r-- | src/Jellyfin.Networking/Manager/NetworkManager.cs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/Jellyfin.Networking/Manager/NetworkManager.cs b/src/Jellyfin.Networking/Manager/NetworkManager.cs index 1da44b048..37160b3ba 100644 --- a/src/Jellyfin.Networking/Manager/NetworkManager.cs +++ b/src/Jellyfin.Networking/Manager/NetworkManager.cs @@ -412,7 +412,9 @@ public class NetworkManager : INetworkManager, IDisposable interfaces.RemoveAll(x => x.AddressFamily == AddressFamily.InterNetworkV6); } - _interfaces = interfaces; + // Users may have complex networking configuration that multiple interfaces sharing the same IP address + // Only return one IP for binding, and let the OS handle the rest + _interfaces = interfaces.DistinctBy(iface => iface.Address).ToList(); } } @@ -1017,7 +1019,7 @@ public class NetworkManager : INetworkManager, IDisposable result = string.Empty; int count = _interfaces.Count; - if (count == 1 && (_interfaces[0].Equals(IPAddress.Any) || _interfaces[0].Equals(IPAddress.IPv6Any))) + if (count == 1 && (_interfaces[0].Address.Equals(IPAddress.Any) || _interfaces[0].Address.Equals(IPAddress.IPv6Any))) { // Ignore IPAny addresses. count = 0; @@ -1049,7 +1051,7 @@ public class NetworkManager : INetworkManager, IDisposable return true; } - _logger.LogWarning("{Source}: External request received, no matching external bind address found, trying internal addresses.", source); + _logger.LogDebug("{Source}: External request received, no matching external bind address found, trying internal addresses", source); } else { @@ -1087,7 +1089,7 @@ public class NetworkManager : INetworkManager, IDisposable if (extResult.Length == 0) { result = string.Empty; - _logger.LogWarning("{Source}: External request received, but no external interface found. Need to route through internal network.", source); + _logger.LogDebug("{Source}: External request received, but no external interface found. Need to route through internal network", source); return false; } |
