aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorZeusCraft10 <akhilachanta8@gmail.com>2025-12-30 17:31:40 -0500
committerZeusCraft10 <akhilachanta8@gmail.com>2025-12-30 17:34:05 -0500
commit72b4faa00b743dc5bbd2e25c54b216510e978a5a (patch)
tree0ac0f91e191cac64844cd8867274c97f9e07e4f7 /tests
parentd28ee6d71415b4c1f5c158f30f427b6952b8d65b (diff)
Fix UDP Auto-Discovery returning IPv6 for cross-subnet IPv4 requests
Fixes #15898 When a UDP discovery request is relayed from a different IPv4 subnet, GetBindAddress() now correctly returns an IPv4 address instead of incorrectly falling back to ::1. Changes: - Loopback fallback now prefers address family matching the source IP - Interface fallback now prefers interfaces matching source address family - Added test case for cross-subnet IPv4 request scenario
Diffstat (limited to 'tests')
-rw-r--r--tests/Jellyfin.Networking.Tests/NetworkParseTests.cs2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/Jellyfin.Networking.Tests/NetworkParseTests.cs b/tests/Jellyfin.Networking.Tests/NetworkParseTests.cs
index 38208476f8..d8748aadac 100644
--- a/tests/Jellyfin.Networking.Tests/NetworkParseTests.cs
+++ b/tests/Jellyfin.Networking.Tests/NetworkParseTests.cs
@@ -377,6 +377,8 @@ namespace Jellyfin.Networking.Tests
[InlineData("192.168.1.208/24,-16,eth16|10.0.0.1/24,10,eth7", "192.168.1.0/24", "10.0.0.1", "192.168.1.209", "10.0.0.1")] // LAN not bound, so return external.
[InlineData("192.168.1.208/24,-16,eth16|10.0.0.1/24,10,eth7", "192.168.1.0/24", "192.168.1.208,10.0.0.1", "8.8.8.8", "10.0.0.1")] // return external bind address
[InlineData("192.168.1.208/24,-16,eth16|10.0.0.1/24,10,eth7", "192.168.1.0/24", "192.168.1.208,10.0.0.1", "192.168.1.210", "192.168.1.208")] // return LAN bind address
+ // Cross-subnet IPv4 request should return IPv4, not IPv6 (Issue #15898)
+ [InlineData("192.168.1.208/24,-16,eth16|fd00::1/64,10,eth7", "192.168.1.0/24", "", "192.168.2.100", "192.168.1.208")]
public void GetBindInterface_ValidSourceGiven_Success(string interfaces, string lan, string bind, string source, string result)
{
var conf = new NetworkConfiguration