mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-11-15 09:59:06 -07:00
Backport pull request #12094 from jellyfin/release-10.9.z
Map IPv6 mapped IPv4 addresses back to IPv4 before running checks
Original-merge: f097aad01e
Merged-by: Bond-009 <bond.009@outlook.com>
Backported-by: Joshua M. Boniface <joshua@boniface.me>
This commit is contained in:
parent
034c13c48f
commit
9c96ce5f6e
@ -919,10 +919,14 @@ public class NetworkManager : INetworkManager, IDisposable
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(address);
|
||||
|
||||
// See conversation at https://github.com/jellyfin/jellyfin/pull/3515.
|
||||
// Map IPv6 mapped IPv4 back to IPv4 (happens if Kestrel runs in dual-socket mode)
|
||||
if (address.IsIPv4MappedToIPv6)
|
||||
{
|
||||
address = address.MapToIPv4();
|
||||
}
|
||||
|
||||
if ((TrustAllIPv6Interfaces && address.AddressFamily == AddressFamily.InterNetworkV6)
|
||||
|| address.Equals(IPAddress.Loopback)
|
||||
|| address.Equals(IPAddress.IPv6Loopback))
|
||||
|| IPAddress.IsLoopback(address))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user