Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Obsolete IPNetwork #46157

Open
Tratcher opened this issue Jan 18, 2023 · 3 comments
Open

Obsolete IPNetwork #46157

Tratcher opened this issue Jan 18, 2023 · 3 comments
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions blocked The work on this issue is blocked due to some dependency
Milestone

Comments

@Tratcher
Copy link
Member

The BCL is planning a replacement for this type: dotnet/runtime#79946

We should consume theirs when available and obsolete ours.


public IList<IPNetwork> KnownNetworks { get; } = new List<IPNetwork>() { new IPNetwork(IPAddress.Loopback, 8) };

Consider adding an implicit converter to minimize the breaking changes in the short term.

@Tratcher Tratcher added blocked The work on this issue is blocked due to some dependency area-runtime labels Jan 18, 2023
@adityamandaleeka adityamandaleeka added this to the .NET 8 Planning milestone Jan 18, 2023
@ghost
Copy link

ghost commented Jan 18, 2023

Thanks for contacting us.

We're moving this issue to the .NET 8 Planning milestone for future evaluation / consideration. We would like to keep this around to collect more feedback, which can help us with prioritizing this work. We will re-evaluate this issue, during our next planning meeting(s).
If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues.
To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Aug 24, 2023
@dotnet-policy-service dotnet-policy-service bot added the pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun label Feb 6, 2024
@wtgodbe wtgodbe removed the pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun label Feb 6, 2024
@dotnet-policy-service dotnet-policy-service bot added the pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun label Feb 6, 2024
@wtgodbe wtgodbe removed the pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun label Feb 13, 2024
@dotnet dotnet deleted a comment from dotnet-policy-service bot Feb 13, 2024
@dotnet dotnet deleted a comment from dotnet-policy-service bot Feb 13, 2024
@amcasey amcasey modified the milestones: .NET 8 Planning, Backlog Feb 14, 2024
@stylpe
Copy link

stylpe commented Mar 25, 2024

This should no longer be blocked, right? I can make a PR for this if you'd like.

There are 3 concrete changes, right?

  • Obsolete HttpOverrides.IPNetwork
  • Add an implicit conversion from that class to System.Net.IPNetwork
  • Change ForwardedHeadersOptions to use System.Net.IPNetwork

That should keep all existing usage working, I think.

@stylpe
Copy link

stylpe commented Mar 25, 2024

I started working on this proactively, and discovered that the HttpOverrides version accepts any IPAddress in the constructors (and masks it during each comparison), while the System.Net version only accepts a value that is a valid network prefix given the accompanying prefix length (which I knew, but I initially assumed the original HttpOverrides edition worked the same way). This obviously makes most of the tests go haywire since the test data is "bad" according to the new version.

So I'd propose the following additional changes:

  • Expand the implicit conversion operator to apply the subnet mask to the IPAddress before passing it to the new class' constructor
  • Scrub the test data to fit the new constraint
  • Possibly even reimplement the HttpOverrides version to internally delegate everything to the System.Net version, then delete the IPNetwork tests (moving any cases to dotnet/runtime that are not already there)

But I suspect this difference might be too much of a breaking change in the first place to mark it obsolete?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions blocked The work on this issue is blocked due to some dependency
Projects
None yet
Development

No branches or pull requests

5 participants