mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-04 18:09:12 +03:00
[PR #13854] [MERGED] Fix negated IP addresses without subnet mask not being parsed correctly #13738
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/jellyfin/jellyfin/pull/13854
Author: @mapret
Created: 4/6/2025
Status: ✅ Merged
Merged: 4/9/2025
Merged by: @crobibero
Base:
master← Head:parse-negated-address-fix📝 Commits (1)
df41f0cFix negated IP addresses without subnet mask not being parsed correctly📊 Changes
2 files changed (+20 additions, -6 deletions)
View changed files
📝
MediaBrowser.Common/Net/NetworkUtils.cs(+16 -5)📝
tests/Jellyfin.Networking.Tests/NetworkParseTests.cs(+4 -1)📄 Description
This PR fixes that IP addresses without subnet mask were not being parsed correctly with the
bool negatedargument of theNetworkUtils.TryParseToSubnetfunction set totrue, which leads to IP addresses from the "LAN networks" setting being classified as excluded in theNetworkManager._excludedSubnetsvariable, which in turn leads to these IP addresses not being considered local.Changes
NetworkUtils.TryParseToSubnetfunction to also respect the ! character for IP address without subnetNetworkParseTests.TryParseValidIPStringsTrueto test with bothtrueandfalsefor thenegatedparameter of theTryParseToSubnetfunctionIssue details
This PR fixes an issue which I encountered with the following setup:
The goal of this setup is that when using the hostname "jellyfin.example.com" from within the LAN, I dont want the bitrate limit to apply since my router supports NAT-loopback and the connection speed is not limited by my internet upload speed. But this does not work, since IP addresses without subnets are not parsed correctly.
A workaround is to use "1.2.3.4/32" instead, which is technically equivalent, but it took me some time to figure out why the setup was not working with just "1.2.3.4", since the info text below the "LAN networks" field suggests that IP addresses with and without subnet mask are supported.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.