FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-151049: Add 2001:1::3/128 (RFC 9665) to ipaddress IPv6 global exceptions by tonghuaroot · Pull Request #151050 · python/cpython · GitHub

/ cpython Public
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (2) .rst  (1) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
2 changes: 2 additions & 0 deletions Lib/ipaddress.py
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
Expand Up @@ -2394,6 +2394,8 @@ class _IPv6Constants:
_private_networks_exceptions = [
IPv6Network('2001:1::1/128'),
IPv6Network('2001:1::2/128'),
# RFC 9665: https://www.rfc-editor.org/rfc/rfc9665.html
IPv6Network('2001:1::3/128'),
IPv6Network('2001:3::/32'),
IPv6Network('2001:4:112::/48'),
IPv6Network('2001:20::/28'),
Expand Down
4 changes: 4 additions & 0 deletions Lib/test/test_ipaddress.py
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
Expand Up @@ -2488,6 +2488,10 @@ def testReservedIpv6(self):
self.assertFalse(ipaddress.ip_address('2001::').is_global)
self.assertTrue(ipaddress.ip_address('2001:1::1').is_global)
self.assertTrue(ipaddress.ip_address('2001:1::2').is_global)
# gh-151049: RFC 9665 anycast address (IANA 2024-04 registration)
self.assertTrue(ipaddress.ip_address('2001:1::3').is_global)
self.assertFalse(ipaddress.ip_address('2001:1::3').is_private)
self.assertFalse(ipaddress.ip_address('2001:1::4').is_global)
self.assertFalse(ipaddress.ip_address('2001:2::').is_global)
self.assertTrue(ipaddress.ip_address('2001:3::').is_global)
self.assertFalse(ipaddress.ip_address('2001:4::').is_global)
Expand Down
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,4 @@
:mod:`ipaddress`: fix ``is_global`` and ``is_private`` for the
``2001:1::3/128`` (DNS-SD Service Registration Protocol Anycast) address,
which IANA registered as globally reachable per :rfc:`9665`. It is now
correctly reported with ``is_global`` ``True`` and ``is_private`` ``False``.
Loading

Back | FazBrowse Home | New Git URL