Merge pull request #16672 from dwandw/fix-ipv6-prefixes-not-recognized-as-proxy
Some checks failed
CodeQL / Analyze (csharp) (push) Waiting to run
Tests / run-tests (macos-latest) (push) Waiting to run
Tests / run-tests (ubuntu-latest) (push) Waiting to run
Tests / run-tests (windows-latest) (push) Waiting to run
OpenAPI Publish / OpenAPI - Publish Artifact (push) Waiting to run
OpenAPI Publish / OpenAPI - Publish Unstable Spec (push) Blocked by required conditions
OpenAPI Publish / OpenAPI - Publish Stable Spec (push) Blocked by required conditions
Project Automation / Project board (push) Waiting to run
Merge Conflict Labeler / Labeling (push) Waiting to run
Stale PR Check / Check PRs with merge conflicts (push) Has been cancelled

Fix IPv6 prefixes not recognized as proxy
This commit is contained in:
Bond-009
2026-04-28 20:21:07 +02:00
committed by GitHub
3 changed files with 10 additions and 9 deletions

View File

@@ -228,6 +228,7 @@
- [MarcoCoreDuo](https://github.com/MarcoCoreDuo)
- [LiHRaM](https://github.com/LiHRaM)
- [MSalman5230](https://github.com/MSalman5230)
- [dwandw](https://github.com/dwandw)
# Emby Contributors

View File

@@ -312,7 +312,7 @@ namespace Jellyfin.Server.Extensions
return;
}
if (prefixLength == NetworkConstants.MinimumIPv4PrefixSize)
if ((addr.AddressFamily == AddressFamily.InterNetwork && prefixLength == NetworkConstants.MinimumIPv4PrefixSize) || (addr.AddressFamily == AddressFamily.InterNetworkV6 && prefixLength == NetworkConstants.MinimumIPv6PrefixSize))
{
options.KnownProxies.Add(addr);
}

View File

@@ -23,8 +23,8 @@ namespace Jellyfin.Server.Tests
true,
true,
new string[] { "192.168.t", "127.0.0.1", "::1", "1234.1232.12.1234" },
new IPAddress[] { IPAddress.Loopback },
new IPNetwork[] { new IPNetwork(IPAddress.IPv6Loopback, 128) });
new IPAddress[] { IPAddress.Loopback, IPAddress.IPv6Loopback },
Array.Empty<IPNetwork>());
data.Add(
true,
@@ -37,8 +37,8 @@ namespace Jellyfin.Server.Tests
true,
true,
new string[] { "::1" },
Array.Empty<IPAddress>(),
new IPNetwork[] { new IPNetwork(IPAddress.IPv6Loopback, 128) });
new IPAddress[] { IPAddress.IPv6Loopback },
Array.Empty<IPNetwork>());
data.Add(
false,
@@ -58,15 +58,15 @@ namespace Jellyfin.Server.Tests
false,
true,
new string[] { "localhost" },
Array.Empty<IPAddress>(),
new IPNetwork[] { new IPNetwork(IPAddress.IPv6Loopback, 128) });
new IPAddress[] { IPAddress.IPv6Loopback },
Array.Empty<IPNetwork>());
data.Add(
true,
true,
new string[] { "localhost" },
new IPAddress[] { IPAddress.Loopback },
new IPNetwork[] { new IPNetwork(IPAddress.IPv6Loopback, 128) });
new IPAddress[] { IPAddress.Loopback, IPAddress.IPv6Loopback },
Array.Empty<IPNetwork>());
return data;
}