[PR #5180] [CLOSED] Fix IsInNetwork for IPv6 addresses #10420

Closed
opened 2026-02-07 06:19:59 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/jellyfin/jellyfin/pull/5180
Author: @daullmer
Created: 2/7/2021
Status: Closed

Base: masterHead: ipv6-network-fix


📝 Commits (10+)

  • ba81e2a Fix IsInNetwork for IPv6 addresses
  • 7707821 Revert IPNetAddress to IPHost
  • 253d191 Change GetNormalizedRemoteIp to return IPAddress
  • 416d2e9 fix LocalAccessHandlerTests.cs
  • bf51d97 Change log message parameter casing
  • 376c935 Remove Logging from NetworkManager.cs
  • be852b3 Merge branch 'master' of github.com:jellyfin/jellyfin into ipv6-network-fix
  • 2d934c7 Fix broken tests
  • 2987751 Cleanup network tests and validate output
  • 6e37bc7 Normalised IPHost.HostName

📊 Changes

11 files changed (+400 additions, -319 deletions)

View changed files

📝 Emby.Server.Implementations/HttpServer/Security/SessionContext.cs (+1 -1)
📝 Jellyfin.Api/Controllers/UserController.cs (+18 -7)
📝 Jellyfin.Api/Helpers/DynamicHlsHelper.cs (+1 -1)
📝 Jellyfin.Api/Helpers/MediaInfoHelper.cs (+3 -2)
📝 Jellyfin.Api/Helpers/RequestHelpers.cs (+1 -1)
📝 MediaBrowser.Common/Extensions/HttpContextExtensions.cs (+2 -2)
📝 MediaBrowser.Common/Net/IPHost.cs (+21 -4)
📝 MediaBrowser.Common/Net/IPNetAddress.cs (+7 -0)
📝 tests/Jellyfin.Api.Tests/Auth/LocalAccessPolicy/LocalAccessHandlerTests.cs (+2 -1)
tests/Jellyfin.Networking.Tests/NetworkManagerTests.cs (+233 -0)
📝 tests/Jellyfin.Networking.Tests/NetworkParseTests.cs (+111 -300)

📄 Description

Changes

  • Change IP parsing from IPHost to IPNetAddress because IPHost can't parse IPv6 address from request (is this the right class or should I use the .NET provided IPAddress @BaronGreenback ?)
  • Change GetNormalizedRemoteIp return value from string to IPAddress and make .ToString()-call, if necessary, from calling method (#5602)
  • Add tests for successful parsing
  • Add Warning if password reset is tried from outside the local network (#5602)
  • Add Debug logging for IsInLocalNetwork
  • Formatting changes in test class
  • Reorganize Tests
  • Validate parsing results for Network tests
  • Fix Parsing of IPv6 address if it's surrounded by []

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/jellyfin/jellyfin/pull/5180 **Author:** [@daullmer](https://github.com/daullmer) **Created:** 2/7/2021 **Status:** ❌ Closed **Base:** `master` ← **Head:** `ipv6-network-fix` --- ### 📝 Commits (10+) - [`ba81e2a`](https://github.com/jellyfin/jellyfin/commit/ba81e2a5b1512a4f033ce5bcffa5f11f76e8d217) Fix IsInNetwork for IPv6 addresses - [`7707821`](https://github.com/jellyfin/jellyfin/commit/7707821f2047d73e25421bff4d58cbd524343578) Revert IPNetAddress to IPHost - [`253d191`](https://github.com/jellyfin/jellyfin/commit/253d19194d7bdcc430cc11b24fb7c28f2cc9f457) Change GetNormalizedRemoteIp to return IPAddress - [`416d2e9`](https://github.com/jellyfin/jellyfin/commit/416d2e9a9d318df262d82c361b1768c088acb443) fix LocalAccessHandlerTests.cs - [`bf51d97`](https://github.com/jellyfin/jellyfin/commit/bf51d97a8856a30b41ca2b93d31c6f8043da988f) Change log message parameter casing - [`376c935`](https://github.com/jellyfin/jellyfin/commit/376c93589f9d6c052da36033bc71f82a39db3ad4) Remove Logging from NetworkManager.cs - [`be852b3`](https://github.com/jellyfin/jellyfin/commit/be852b32dd78a59b5be49d4e0d28bd3f7ff16927) Merge branch 'master' of github.com:jellyfin/jellyfin into ipv6-network-fix - [`2d934c7`](https://github.com/jellyfin/jellyfin/commit/2d934c71fffe7a40e177e6f52a84dbaef5225502) Fix broken tests - [`2987751`](https://github.com/jellyfin/jellyfin/commit/29877517de0060bdf4840641f57938711a2f82f2) Cleanup network tests and validate output - [`6e37bc7`](https://github.com/jellyfin/jellyfin/commit/6e37bc7ffefa85c3f6f80b25dfe6e5c25f8993e8) Normalised IPHost.HostName ### 📊 Changes **11 files changed** (+400 additions, -319 deletions) <details> <summary>View changed files</summary> 📝 `Emby.Server.Implementations/HttpServer/Security/SessionContext.cs` (+1 -1) 📝 `Jellyfin.Api/Controllers/UserController.cs` (+18 -7) 📝 `Jellyfin.Api/Helpers/DynamicHlsHelper.cs` (+1 -1) 📝 `Jellyfin.Api/Helpers/MediaInfoHelper.cs` (+3 -2) 📝 `Jellyfin.Api/Helpers/RequestHelpers.cs` (+1 -1) 📝 `MediaBrowser.Common/Extensions/HttpContextExtensions.cs` (+2 -2) 📝 `MediaBrowser.Common/Net/IPHost.cs` (+21 -4) 📝 `MediaBrowser.Common/Net/IPNetAddress.cs` (+7 -0) 📝 `tests/Jellyfin.Api.Tests/Auth/LocalAccessPolicy/LocalAccessHandlerTests.cs` (+2 -1) ➕ `tests/Jellyfin.Networking.Tests/NetworkManagerTests.cs` (+233 -0) 📝 `tests/Jellyfin.Networking.Tests/NetworkParseTests.cs` (+111 -300) </details> ### 📄 Description **Changes** - ~~Change IP parsing from `IPHost` to `IPNetAddress` because `IPHost` can't parse IPv6 address from request (is this the right class or should I use the .NET provided `IPAddress` @BaronGreenback ?)~~ - Change `GetNormalizedRemoteIp` return value from `string` to `IPAddress` and make `.ToString()`-call, if necessary, from calling method (#5602) - Add tests for successful parsing - Add Warning if password reset is tried from outside the local network (#5602) - ~~Add Debug logging for `IsInLocalNetwork`~~ - Formatting changes in test class - Reorganize Tests - Validate parsing results for Network tests - Fix Parsing of IPv6 address if it's surrounded by [] --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-07 06:19:59 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#10420