From 8bd9802afd32d77f29bae5de54ddc1cbde2aed75 Mon Sep 17 00:00:00 2001 From: gggg5151 <166692777+gggg5151@users.noreply.github.com> Date: Thu, 22 Oct 2026 18:00:24 +0900 Subject: [PATCH] gh-160227: Add 192.88.99.2/32 (RFC 6751) to ipaddress IPv4 private networks IANA's IPv4 Special-Purpose Address Registry lists 192.88.99.2/32 (6a44-relay anycast address, RFC 6751) as not globally reachable. The row was added to the registry on 2025-06-26, after the IPv4 list was last updated in gh-113171. --- Lib/ipaddress.py | 2 ++ Lib/test/test_ipaddress.py | 3 +++ .../Library/2026-10-22-08-50-54.gh-issue-160227.Zq7mRb.rst | 3 +++ 3 files changed, 8 insertions(+) create mode 100644 Misc/NEWS.d/next/Library/2026-10-22-08-50-54.gh-issue-160227.Zq7mRb.rst diff --git a/Lib/ipaddress.py b/Lib/ipaddress.py index 8ac2a537c46dee..f48a52af34bdc9 100644 --- a/Lib/ipaddress.py +++ b/Lib/ipaddress.py @@ -1637,6 +1637,8 @@ class _IPv4Constants: IPv4Network('192.0.0.0/24'), IPv4Network('192.0.0.170/31'), IPv4Network('192.0.2.0/24'), + # RFC 6751: https://www.rfc-editor.org/rfc/rfc6751.html + IPv4Network('192.88.99.2/32'), IPv4Network('192.168.0.0/16'), IPv4Network('198.18.0.0/15'), IPv4Network('198.51.100.0/24'), diff --git a/Lib/test/test_ipaddress.py b/Lib/test/test_ipaddress.py index 600e1f19a9cdc2..52cf64b46b7a59 100644 --- a/Lib/test/test_ipaddress.py +++ b/Lib/test/test_ipaddress.py @@ -2409,6 +2409,9 @@ def testReservedIpv4(self): self.assertTrue(ipaddress.ip_address('192.0.0.9').is_global) self.assertTrue(ipaddress.ip_address('192.0.0.10').is_global) self.assertFalse(ipaddress.ip_address('192.0.0.255').is_global) + # gh-160227: 6a44-relay anycast address (RFC 6751) + self.assertFalse(ipaddress.ip_address('192.88.99.2').is_global) + self.assertTrue(ipaddress.ip_address('192.88.99.2').is_private) self.assertEqual(True, ipaddress.ip_address('169.254.100.200').is_link_local) diff --git a/Misc/NEWS.d/next/Library/2026-10-22-08-50-54.gh-issue-160227.Zq7mRb.rst b/Misc/NEWS.d/next/Library/2026-10-22-08-50-54.gh-issue-160227.Zq7mRb.rst new file mode 100644 index 00000000000000..d948f8b8c266ac --- /dev/null +++ b/Misc/NEWS.d/next/Library/2026-10-22-08-50-54.gh-issue-160227.Zq7mRb.rst @@ -0,0 +1,3 @@ +Fix :attr:`ipaddress.IPv4Address.is_global` and +:attr:`~ipaddress.IPv4Address.is_private` for ``192.88.99.2``, the 6a44-relay +anycast address (:rfc:`6751`), which IANA lists as not globally reachable.