aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShadowghost <Shadowghost@users.noreply.github.com>2025-02-03 17:07:13 -0500
committerBond_009 <bond.009@outlook.com>2025-02-03 17:07:13 -0500
commitc77b3fa25810f3824ad3ad4568fff390326b2a51 (patch)
treefdb2fb76637f03fb06f1cf3ad074c731db7a9b1c /src
parent10f4f8b2ab727f6a0b30b7e8edcc6c9d47205add (diff)
Backport pull request #13448 from jellyfin/release-10.10.z
Fix interface ordering again Original-merge: 731874429c4c9bf5e2374f4160893f0f59d771e7 Merged-by: Bond-009 <bond.009@outlook.com> Backported-by: Bond_009 <bond.009@outlook.com>
Diffstat (limited to 'src')
-rw-r--r--src/Jellyfin.Networking/Manager/NetworkManager.cs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Jellyfin.Networking/Manager/NetworkManager.cs b/src/Jellyfin.Networking/Manager/NetworkManager.cs
index 7de919735..dd01e9533 100644
--- a/src/Jellyfin.Networking/Manager/NetworkManager.cs
+++ b/src/Jellyfin.Networking/Manager/NetworkManager.cs
@@ -1065,7 +1065,8 @@ public class NetworkManager : INetworkManager, IDisposable
// Check to see if any of the external bind interfaces are in the same subnet as the source.
// If none exists, this will select the first external interface if there is one.
bindAddress = externalInterfaces
- .OrderBy(x => x.Subnet.Contains(source))
+ .OrderByDescending(x => x.Subnet.Contains(source))
+ .ThenByDescending(x => x.Subnet.PrefixLength)
.ThenBy(x => x.Index)
.Select(x => x.Address)
.First();
@@ -1082,7 +1083,8 @@ public class NetworkManager : INetworkManager, IDisposable
// Check to see if any of the internal bind interfaces are in the same subnet as the source.
// If none exists, this will select the first internal interface if there is one.
bindAddress = _interfaces.Where(x => IsInLocalNetwork(x.Address))
- .OrderBy(x => x.Subnet.Contains(source))
+ .OrderByDescending(x => x.Subnet.Contains(source))
+ .ThenByDescending(x => x.Subnet.PrefixLength)
.ThenBy(x => x.Index)
.Select(x => x.Address)
.FirstOrDefault();