gh-124217, ipaddress: Add RFC 9637 reserved IPv6 block 3fff::/20 (#124240)

Signed-off-by: y5c4l3 <y5c4l3@proton.me>
This commit is contained in:
Y5 2024-09-20 11:01:28 +00:00 committed by GitHub
parent 622368d99c
commit db6eb3640a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 0 deletions

View File

@ -2375,6 +2375,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'),
]

View File

@ -2433,6 +2433,8 @@ class IpaddrUnitTest(unittest.TestCase):
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)

View File

@ -0,0 +1 @@
Add RFC 9637 reserved IPv6 block ``3fff::/20`` in :mod:`ipaddress` module.