Skip to content

Commit

Permalink
[3.13] gh-124217, ipaddress: Add RFC 9637 reserved IPv6 block `3fff::…
Browse files Browse the repository at this point in the history
…/20` (GH-124240) (#124282)

gh-124217, ipaddress: Add RFC 9637 reserved IPv6 block `3fff::/20` (GH-124240)
(cherry picked from commit db6eb36)

Signed-off-by: y5c4l3 <[email protected]>
Co-authored-by: Y5 <[email protected]>
  • Loading branch information
miss-islington and y5c4l3 authored Oct 7, 2024
1 parent 9e218af commit a93716f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Lib/ipaddress.py
Original file line number Diff line number Diff line change
Expand Up @@ -2383,6 +2383,8 @@ class _IPv6Constants:
IPv6Network('2001:db8::/32'),
# IANA says N/A, let's consider it not globally reachable to be safe
IPv6Network('2002::/16'),
# RFC 9637: https://www.rfc-editor.org/rfc/rfc9637.html#section-6-2.2
IPv6Network('3fff::/20'),
IPv6Network('fc00::/7'),
IPv6Network('fe80::/10'),
]
Expand Down
2 changes: 2 additions & 0 deletions Lib/test/test_ipaddress.py
Original file line number Diff line number Diff line change
Expand Up @@ -2427,6 +2427,8 @@ def testReservedIpv6(self):
self.assertTrue(ipaddress.ip_address('2001:30::').is_global)
self.assertFalse(ipaddress.ip_address('2001:40::').is_global)
self.assertFalse(ipaddress.ip_address('2002::').is_global)
# gh-124217: conform with RFC 9637
self.assertFalse(ipaddress.ip_address('3fff::').is_global)

# some generic IETF reserved addresses
self.assertEqual(True, ipaddress.ip_address('100::').is_reserved)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add RFC 9637 reserved IPv6 block ``3fff::/20`` in :mod:`ipaddress` module.

0 comments on commit a93716f

Please sign in to comment.