diff options
| author | Neuheit <38368299+Neuheit@users.noreply.github.com> | 2022-10-20 16:17:56 -0400 |
|---|---|---|
| committer | Neuheit <38368299+Neuheit@users.noreply.github.com> | 2022-10-20 16:17:56 -0400 |
| commit | c9a387943f05cbbd11c5b92d900ff850055ed4f3 (patch) | |
| tree | fd04664b700e3c16e59aea03f0fa196d8a8a4f2c /Jellyfin.Networking/Manager/NetworkManager.cs | |
| parent | ac0dbd0b40b51753cb0a431f2fbc1c4e5a843aaf (diff) | |
Add IPv4 fallback from IPv6 failure.
Co-authored-by: BaronGreenback <jimcartlidge@yahoo.co.uk>
Diffstat (limited to 'Jellyfin.Networking/Manager/NetworkManager.cs')
| -rw-r--r-- | Jellyfin.Networking/Manager/NetworkManager.cs | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/Jellyfin.Networking/Manager/NetworkManager.cs b/Jellyfin.Networking/Manager/NetworkManager.cs index 9e06cdfe7..631e9cdb8 100644 --- a/Jellyfin.Networking/Manager/NetworkManager.cs +++ b/Jellyfin.Networking/Manager/NetworkManager.cs @@ -594,6 +594,7 @@ namespace Jellyfin.Networking.Manager IsIP4Enabled = Socket.OSSupportsIPv4 && config.EnableIPV4; IsIP6Enabled = Socket.OSSupportsIPv6 && config.EnableIPV6; + HappyEyeballs.HttpClientExtension.UseIPv6 = IsIP6Enabled; if (!IsIP6Enabled && !IsIP4Enabled) { @@ -838,9 +839,19 @@ namespace Jellyfin.Networking.Manager try { await Task.Delay(2000).ConfigureAwait(false); - InitialiseInterfaces(); - // Recalculate LAN caches. - InitialiseLAN(_configurationManager.GetNetworkConfiguration()); + + var config = _configurationManager.GetNetworkConfiguration(); + // Have we lost IPv6 capability? + if (IsIP6Enabled && !Socket.OSSupportsIPv6) + { + UpdateSettings(config); + } + else + { + InitialiseInterfaces(); + // Recalculate LAN caches. + InitialiseLAN(config); + } NetworkChanged?.Invoke(this, EventArgs.Empty); } |
