-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
GH-113171: Fix "private" (non-global) IP address ranges #113179
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
Merged
Merged
Changes from 7 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
b83b987
GH-113171: Fix "private" (really non-global) IP address ranges
jstasiak 2a8d49b
Simplify
jstasiak 7c9235e
Remove an unnecessary import
jstasiak d87ac9e
Update IP networks too
jstasiak e2d4582
Merge remote-tracking branch 'origin/main' into fix-ipaddress-private…
jstasiak f031f6e
Add documentation
jstasiak d3ee80d
Actually fix the shared address space too
jstasiak 965e3a0
Revert "Actually fix the shared address space too"
jstasiak 5f41fff
Make the news entry nicer
jstasiak File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
Misc/NEWS.d/next/Library/2024-03-14-01-38-44.gh-issue-113171.VFnObz.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
Fixed various false positives and false negatives in | ||
|
||
* :attr:`ipaddress.IPv4Address.is_global` | ||
* :attr:`ipaddress.IPv4Address.is_private` | ||
* :attr:`ipaddress.IPv6Address.is_global` | ||
* :attr:`ipaddress.IPv6Address.is_private` | ||
|
||
An the corresponding :class:`ipaddress.IPv4Network` and :class:`ipaddress.IPv6Network` | ||
attributes. | ||
|
||
The new behavior: | ||
|
||
* ``192.0.0.0/24`` is considered private with the exception of ``192.0.0.9/32`` and | ||
``192.0.0.10/32`` (previously: only the ``192.0.0.0/29`` sub-range was considered private). | ||
* ``64:ff9b:1::/48`` is considered private. | ||
* ``2002::/16`` is considered private. | ||
* There are exceptions within ``2001::/23`` (otherwise considered private): ``2001:1::1/128``, | ||
``2001:1::2/128``, ``2001:3::/32``, ``2001:4:112::/48``, ``2001:20::/28``, ``2001:30::/28``. | ||
The exceptions are not considered private. | ||
* The shared address space (``100.64.0.0/10``) is not treated in any special way anymore, | ||
previously it was considered both not private and not global. It is considered private now. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.